4

在编译php-fpm0.6的时候需要注意的一些问题

 3 years ago
source link: https://blogread.cn/it/article/2011?f=hot1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
您现在的位置首页 --> PHP --> 在编译php-fpm0.6的时候需要注意的一些问题

在编译php-fpm0.6的时候需要注意的一些问题

浏览:1661次  出处信息

也许大家都在用php-fpm0.5系列..其实php-fpm0.6早就发布了..并且再上次fix_pathinfo漏洞的时候.有人说过0.6不受这个漏洞的影响..

看来使用0.6还是还是有些必要的..

但是0.6比较起0.5来说..变化很大..代码上我不太清楚..但是从编译的步骤上来讲..确实有些我们需要注意的事情.

上次我曾经说过关于编译PHP5.2.12+php-fpm-0.6的问题..这次加上几个新的 就重新写一遍吧..

我这里就用php5.2.13和php-fpm-0.6~5.2.patch来打比方.

php-fpm需要autoconf2.13 所以我们需要先安装autoconf

以下是引用片段:
# tar -zxvf autoconf-2.13.tar.gz
# cd autoconf-2.13
# ./configure --prefix=/usr/local/autoconf
# make
# make install
# export PHP_AUTOCONF=/usr/local/autoconf/bin/autoconf
# export PHP_AUTOHEADER=/usr/local/autoconf/bin/autoheader

另外还需要libevent-1.4.13-stable.tar.gz

以下是引用片段:
# tar zxvf libevent-1.4.13-stable.tar.gz
# cd libevent-1.4.13-stable/
# ./configure --prefix=/usr/local/libevent
# make && make install

最后还需要一个libiconv-1.13.1.tar.gz

以下是引用片段:
# tar zxvf libiconv-1.13.1.tar.gz
# cd libiconv-1.13.1/
# ./configure --prefix=/usr/local/libiconv
# make && make install

现在才可以安装php5.2.13..这里需要注意的是 php-fpm0.5的编译参数是 -enabled-fpm 而0.6改成了 -with-fpm

以下是引用片段:
# tar -jxvf php-5.2.13.tar.bz2
# cd php-5.2.13/
# patch -d php-5.2.12 -p1 < php-fpm-0.6~5.2.patch
# rm -rf configure
# ./buildconf --force
# ./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-libevent=/usr/local/libevent --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --with-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear
# make 
# make install
# cp php.ini-dist /usr/local/www/php/php.ini这样基本就可以了..

还有一点 如果你php.ini中开启了open_basedir并且安装了eAccelerator了..

那么需要修改一下eAccelerator的源码在编译安装..

下载eaccelerator 0.9.6后先不要安装,解包后找到eaccelerator.c这个文件,打开第1156行,这样的:
if (PG(open_basedir) && php_check_open_basedir(realname TSRMLS_CC)) {
修改成:
if (PG(open_basedir) && php_check_open_basedir(file_handle->filename TSRMLS_CC)) {

貌似没什么问题了..以后想起来再加把..

建议继续学习:

QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK