一次编译php参数

1.

先在/home/nouse下编译安装apache2

2.

在/home/nouse下编译php

./configure --prefix=/home/nouse/php --with-apxs2=/home/nouse/apache2/bin/apxs --with-mysql=/usr/lib64/mysql --with-curl=/home/curl --with-config-file-path=/home/php/etc --enable-ftp --enable-bz2 --with-gettext --enable-calendar --enable-mbstring --enable-bcmatch --enable-sockets --enable-exif --enable-soap --enable-sysvmsg --enable-wddx --with-openssl=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mcrypt=/usr/local/lib --with-freetype-dir=/usr/local/include --enable-zip


注意:prefix 和apxs2的参数位置一定要指定到/home/nouse,这个文件夹的作用不大,主要是产生libphp.so

3.

将里面apache2/modules/libphp5.so的保存

4.

编译使用的php

参数除了prefix 和apxs2不同,其余同上。例如

./configure --prefix=/home/php --with-apxs2=/usr/bin/apxs2 --with-mysql=/usr/lib64/mysql --with-curl=/home/curl --with-config-file-path=/home/php/etc --enable-ftp --enable-bz2 --with-gettext --enable-calendar --enable-mbstring --enable-bcmatch --enable-sockets --enable-exif --enable-soap --enable-sysvmsg --enable-wddx --with-openssl=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mcrypt=/usr/local/lib --with-freetype-dir=/usr/local/include --enable-zip

5.

将之前的libphp.so覆盖到/usr/lib/apache2/modules/下面。

6.

将/home下面的php源码包里面的php.ini-dist放置到/home/php/etc下面,用于加载配置文件。


你可能感兴趣的:(编译php)