参考
需要预装的软件包:
mysql
apt-get install libxml2
apt-get install libxml2-dev
apt-get install zlib1g-dev
(默认启用sqlite3,在src的ext下含sqlite代码,不必事先下载安装sqlite3)
编译:
./configure --enable-fpm --with-mysql --prefix=/opt/php --with-zlib
(--with-fpm-user=nginx --with-fpm-group=nginx)
make
make test
make install
配置:
默认php.ini放在在${PREFIX}/lib目录下。
php.ini
date.timezone = “Asia/Shanghai”
cgi.fix_pathinfo=0
配置php-fpm
php-fpm.conf
user = nobody
group = nogroup
php-fpm -c /usr2/php-5.4.7
ps -ef|grep php-fpm
kill …
配置nginx:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
phpinfo:
# cat /usr/share/nginx/www/phpinfo.php
阅读(1511) | 评论(0) | 转发(0) |