您的位置:首页 > 编程语言 > PHP开发

一次编译php参数

2013-09-27 17:20 148 查看
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下面,用于加载配置文件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: