日期:2014-05-16  浏览次数:20837 次

移植Sqlite2+PHP5.2+apache1.3到ARM平台

提醒:在整个移植的过程中注意各软件包的版本

本文中Sqlite使用的是Sqlite2.8.17.tar.gz,Apache使用的是1.3.39,PHP使用的5.2.13

一:Sqlite数据库移植

1)下载sqlite2.8.17.tar.gz,(版本号至少应该保存前两位对应)

2)把这个压缩包放到/home/chen的目录下,并且解压。再建立一个sqlite目录,作为安装目录。

3)进入到sqlite2.8.17目录下,执行如下命令

CC=arm-linux-gcc ./configure --prefix=/home/chen/sqlite --host=arm-linux

4)make        5)make install 。安装成功后,在sqlite这个目录下有三个文件夹:bin、lib、include

6)进入lib目录中,arm-linux-strip libsqlite.so.0.8.6

7)将bin目录下的sqlite拷贝到目标板的/usr/bin目录下。

8)将lib目录下的libsqlite.so.0.8.6拷贝到/usr/lib目录下。

9)登录到开发板中,进入/usr/lib目录,创建一个符号链接ln -s libsqlite.so.8.6 libsqlite.so.0

到此sqlite数据库就算是移植完毕了。在开发板上面运行sqlite看到如下画面,则sqlite安装成功


 

二:Apache服务器移植

1)下载apache1.3.39的软件包。apache1.3.39.tar.gz,注意版本的移植性。

2)在/home/chen/目录下建立两个文件夹:arm和source

3)把软件包分别拷贝到arm与source这两个文件夹中,并使用tar -xzvf apache1.3.39.tar.gz进行解压。

4)进入/home/chen/source/apache1.3.39/src这个文件目录中。执行./Configure。生成一个Makefile文件。

5)返回到/home/chen/source/apache1.3.39这个目录中,执行./configure。再执行make。这时可能有两种情况

                                (①)成功运行出make,无需额外的操作。

                                (②)make出错,错误如下:

                                

If you don't do this, the installation will fail because of the following error:
		htpasswd.c:101: error: conflicting types for 'getline'
		/usr/include/stdio.h:651: note: previous declaration of 'getline' was 			here
		make[2]: *** [htpasswd.o] Error 1
		make[2]: Leaving directory `/home/ISPConfig-						2.2.stable/install_ispconfig/compile_aps/apache_1.3.41/src/support'
		make[1]: *** [build-support] Error 1
		make[1]: Leaving directory `/home/ISPConfig-			2.2.stable/install_ispconfig/compile_aps/apache_1.3.41'
		make: *** [build] Error 2
		ERROR: Could not make Apache


这时打开错误提示的文件/usr/include/stdio.h,找到对应的行,把getline改成parseline(记住在编译完成所有工作时,把他修改回去。)

6)观察/home/chen/source/apache1.3.39/src/main这个目录下是否有gen_test_char和gen_uri_delims这个两个可执行文件。如果上述步骤没有遗漏,应该会出现这两个可执行文件

7)进入/home/chen/arm/apache1.3.39/src中,执行

                           &