Apache+php5+sqlite3 Transplant

Source: Internet
Author: User
Apache+php5+sqlite3 Transplant

1. Sqlite3 Transplant Reference http://blog.csdn.net/huyubin/article/details/46726585 dynamic
Compile.
The Apache runtime invokes the libsqlite3.so dynamic library, so you need to:
A. Copy the 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 http://php.net/releases/
B. Enter the php-5.6.10 directory and create a new installation directory:
mkdir My_install
C. Implementation./configure, production makefile file:
CC=/USR/LOCAL/ARM/ARM-XILINX/LIN/BIN/ARM-XILINX-LINUX-GNUEABI-GCC cxx=/usr/local/arm/arm-xilinx/lin/bin/ arm-xilinx-linux-gnueabi-g++ cflags= "-g-o2" LDFLAGS+=-LDL./configure--prefix=/home/huyubin/zynq/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
Where:--with-apxs2=/mnt/ram/apache/bin/apxs//For the Apache installation directory, used to generate libphp5.so. (The host and ARM board catalogs are consistent)
--with-config-file-path=/mnt/flash/php//Configure PHP configuration file php.ini Directory
--with-config-file-scan-dir=/mnt/flash/php

Sqlite3 host installation directory, need to be used at compile time (need to complete sqlite3 compilation first)
--with-sqlite3=/home/huyubin/zynq/sqlite/sqlite-autoconf-3081002/my_install
D. Make
E. sudo make install

PHP extension PDO compilation Installation reference:
http://blog.csdn.net/liruxing1715/article/details/8268513
F. Production pdo.so, into the Ext/pdo directory execution
.. /.. /my_install/bin/phpize
CC=/USR/LOCAL/ARM/ARM-XILINX/LIN/BIN/ARM-XILINX-LINUX-GNUEABI-GCC cxx=/usr/local/arm/arm-xilinx/lin/bin/ arm-xilinx-linux-gnueabi-g++ cflags= "-g-o2" LDFLAGS+=-LDL./configure--prefix=/home/huyubin/zynq/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, enter Ext/pdo_sqlite
.. /.. /my_install/bin/phpize
CC=/USR/LOCAL/ARM/ARM-XILINX/LIN/BIN/ARM-XILINX-LINUX-GNUEABI-GCC cxx=/usr/local/arm/arm-xilinx/lin/bin/ arm-xilinx-linux-gnueabi-g++ cflags= "-g-o2" LDFLAGS+=-LDL./configure--prefix=/home/huyubin/zynq/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 the php.ini-development in the php-5.6.10 directory to php.ini as a PHP configuration file,
Make the following changes:
Add to:
Extension_dir = "/mnt/flash/php/"
Extension=pdo.so
Extension=pdo_sqlite.so
Modify:
[Sqlite3]
Sqlite3.extension_dir = "/usr/lib/"

3. Apache Transplant Reference http://blog.csdn.net/huyubin/article/details/46817007,
However, the httpd.conf file needs to be modified again:
A. Add support for PHP modules (if not manually modified, will be automatically modified when compiling PHP later)
LoadModule Php5_module modules/libphp5.so
B. Identification of documents such as *.php

SetHandler application/x-httpd-php

4. Check the/mnt/ram/apache/moudles/directory of the embedded Development Board for any libphp5.so, this file is
Generated in the Apache installation directory when compiling PHP.
5. Create a new directory/mnt/flash/php/, copy php.ini, pdo.so, and pdo_sqlite.so to this directory.

6. Confirm that the libsqlite3.so.o.8.6 is in the/usr/lib directory and establish a soft connection.

PHP Code:

Need to manually create the TEST.DB database

It works!

Lasterrormsg (); } else{ echo "Open database successfully\n"; }
  Phpinfo ();? >

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the apache+php5+sqlite3 transplant, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.