<span style="font-size:18px;">tar -zxvf libxml2-2.6.32.tar.gz</span>
执行:./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2 --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libevent-dir=libevent
这里超级重要,php5.3以后支持php-fpm启动,如果这里没有配置好,就会导致后面无法启动php【apache作为服务器的话,无所谓,但我们现在是nginx】
./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2 --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libevent-dir=libevent
于是查看php-fpm文档,会发现其中一个选项:-R

所以正确的启动应该是:/usr/local/php/etc/php-fpm -R
立即学习“PHP免费学习笔记(深入)”;
/usr/local/php/etc/php-fpm -R
netstat -lnt | grep 9000
netstat -lnt | grep 9000
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root /www/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /www/web/$fastcgi_script_name;
include fastcgi_params;
}配置好了后,再次在家nginx,执行:/usr/sbin/nginx -s reload
/usr/sbin/nginx -s reload

以上就介绍了Linux下安装php,并配置到nginx,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号