: This article describes how to Port apache + php5 + sqlite3. For more information about PHP tutorials, see. Apache + php5 + sqlite3 Port
1. sqlite3 porting reference http://blog.csdn.net/huyubin/article/details/46726585 dynamics
Compile.
The dynamic library libsqlite3.so will be called when apache is running, so you need:
A. copy libsqlite3.so. o.8.6 to the/usr/lib directory.
B. create a soft link in the/usr/lib directory.
Ln-s libsqlite3.so. 0.8.6 libsqlite3.so
Ln-s libsqlite3.so. o.8.6 libsqlite3.so. 0
2. php porting
A. download php-5.6.10.tar.gz from the http://php.net/releases/
B. go to the php-5.6.10 directory and create the installation directory:
Mkdir my_install
C. Execute./configure to produce the Makefile file:
CC =/usr/local/arm-xilinx/lin/bin/arm-xilinx-linux-gnueabi-gcc CXX =/usr/local/arm-xilinx/lin /bin/arm-xilinx-linux-gnueabi-g ++ CFLAGS = "-g-O2" LDFLAGS ++ =-ldl. /configure -- prefix =/home/huyubin/javasq/php/php-5.6.10/my_install/-- host = arm-xilinx-linux-gnueabi -- disable-all -- with-apxs2 =/mnt/ram/ apache/bin/apxs -- with-config-file-path =/mnt/flash/php -- with-config-file-scan-dir =/mnt/flash/php -- with-sqlite3 = /home/huyubin/zynq/sqlite/sqlite-autoconf-3081002/my_install -- with-pdo-sqlite -- enable-pdo
Here: -- with-apxs2 =/mnt/ram/apache/bin/apxs // is the installation directory of apache, used to generate libphp5.so. (The Directory of the host and ARM Board is the same)
-- With-config-file-path =/mnt/flash/php // Configure the PHP configuration file php. ini Directory
-- With-config-file-scan-dir =/mnt/flash/php
// Sqlite3 host installation directory, which must be used during compilation (sqlite3 compilation must be completed first)
-- With-sqlite3 =/home/huyubin/zynq/sqlite/sqlite-autoconf-3081002/my_install
D. make
E. sudo make install
PHP extension PDO compilation and installation reference:
Http://blog.csdn.net/liruxing1715/article/details/8268513
F. generate pdo. so and enter the ext/pdo directory for execution.
../My_install/bin/phpize
CC =/usr/local/arm-xilinx/lin/bin/arm-xilinx-linux-gnueabi-gcc CXX =/usr/local/arm-xilinx/lin /bin/arm-xilinx-linux-gnueabi-g ++ CFLAGS = "-g-O2" LDFLAGS ++ =-ldl. /configure -- prefix =/home/huyubin/javasq/php/php-5.6.10/my_install/-- host = arm-xilinx-linux-gnueabi -- with-php-c /.. /my_install/bin/php-config
Make
Sudo make install
G. generate pdo_sqlite.so and enter ext/pdo_sqlite
../My_install/bin/phpize
CC =/usr/local/arm-xilinx/lin/bin/arm-xilinx-linux-gnueabi-gcc CXX =/usr/local/arm-xilinx/lin /bin/arm-xilinx-linux-gnueabi-g ++ CFLAGS = "-g-O2" LDFLAGS ++ =-ldl. /configure -- prefix =/home/huyubin/javasq/php/php-5.6.10/my_install/-- host = arm-xilinx-linux-gnueabi -- with-php-c /.. /my_install/bin/php-config -- with-pdo-sqlite =/home/huyubin/zynq/sqlite/sqlite-autoconf-3081002/my_install/
Make
Sudo make install
H. change php. ini-development under the php-5.6.10 directory to php. ini, as the PHP configuration file,
Make the following changes:
Add:
Extension_dir = "/mnt/flash/php /"
Extension = pdo. so
Extension = pdo_sqlite.so
Modify:
[Sqlite3]
Sqlite3.extension _ dir = "/usr/lib /"
3. apache porting reference http://blog.csdn.net/huyubin/article/details/46817007,
However, the httpd. conf file needs to be modified again:
A. added support for the PHP module (if not manually modified, it will be automatically modified when php is compiled later)
LoadModule php5_module modules/libphp5.so
B. identify files such as *. php
SetHandler application/x-httpd-php
4. check whether libphp5.so is in the/mnt/ram/apache/moudles/directory of the embedded development board. This file is
Generated in the apache installation directory during PHP compilation.
5. create the directory/mnt/flash/php/and copy php. ini, pdo. so, and pdo_sqlite.so to this directory.
6. check that libsqlite3.so. o.8.6 is in the/usr/lib directory and establish a soft connection.
PHP code:
You need to manually create the test. db database
It works!
lastErrorMsg(); }else{ echo "Open database successfully\n"; }
phpinfo();?>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces the apache + php5 + sqlite3 transplantation, including some content, and hope to be helpful to friends who are interested in PHP tutorials.