linux下PHP5.3.5+nginx源码安装
2011-01-11 12:04
615 查看
先装php5.3.5
'./configure' '--prefix=/home/php535' '--enable-xml' '--enable-fpm' '--with-curl'
这里最重要的是--enable-fpm。fastcgi已经在php5.3.5的core中了,不必再configure时--enable-fastcgi了。老版本的需要加,比如5.2
make && make install
这都是顺利的,然后就不知怎么启,误以为phppath/sbin/php-fpm就行了,可是一直起不来,报错:failed to post process the configuration。baidu了一个周末,还是不明白。觉得我已在etc下写了php-fpm.conf了呀,又以phppath/sbin/php-fpm -y etc/php-fpm.conf起,依然起不来。想了N久,觉得它这里指的conf文件应该php.ini,于是从源码中把php.ini找到,拷了过来,依然起不来.......
在php社区中逛时,发现有人提到的init.d.php-fpm。于是从源码中把它拷过来, phppath/init.d.php-fpm start。就起来了。。。
这都哪儿跟哪儿啊。
nginx其实已装了,只是光能解析html,于是改了nginx.conf文件
location ~ /.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
}
把这段加上,写了个index.php,果然可以解析了。。。。
ps:init.d.php-fpm start这个如果重新运行了时,一定nginx也要重新启一下,否则,虽然php-fpm与nginx通信的端口起来了,但nginx所listen的端口仍然没有起来
其实,nginx支持平滑重启,不必停止服务的,这也是它广受好评的原因。具体的命令就是kill -HUP `cat yourpath/nginx/logs/nginx.pid`
但这个重启,并不好,在nginx.conf有问题时(也许是新加了模块时),并未真正重启,还是用nginx/sbin/nginx -c nginx.conf吧。当然停止用nginx/sbin/nginx -s stop
还是觉得,只是上网找别人写的例子,不够。尤其有的人写的太短,根本没说明白怎么样一步一步地修改,安装,有些人写的太长,扯来扯去的,找不出骨架。
我写的也不好。。。。所以写个技术文档,不是个容易的活。。。
'./configure' '--prefix=/home/php535' '--enable-xml' '--enable-fpm' '--with-curl'
这里最重要的是--enable-fpm。fastcgi已经在php5.3.5的core中了,不必再configure时--enable-fastcgi了。老版本的需要加,比如5.2
make && make install
这都是顺利的,然后就不知怎么启,误以为phppath/sbin/php-fpm就行了,可是一直起不来,报错:failed to post process the configuration。baidu了一个周末,还是不明白。觉得我已在etc下写了php-fpm.conf了呀,又以phppath/sbin/php-fpm -y etc/php-fpm.conf起,依然起不来。想了N久,觉得它这里指的conf文件应该php.ini,于是从源码中把php.ini找到,拷了过来,依然起不来.......
在php社区中逛时,发现有人提到的init.d.php-fpm。于是从源码中把它拷过来, phppath/init.d.php-fpm start。就起来了。。。
这都哪儿跟哪儿啊。
nginx其实已装了,只是光能解析html,于是改了nginx.conf文件
location ~ /.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
}
把这段加上,写了个index.php,果然可以解析了。。。。
ps:init.d.php-fpm start这个如果重新运行了时,一定nginx也要重新启一下,否则,虽然php-fpm与nginx通信的端口起来了,但nginx所listen的端口仍然没有起来
其实,nginx支持平滑重启,不必停止服务的,这也是它广受好评的原因。具体的命令就是kill -HUP `cat yourpath/nginx/logs/nginx.pid`
但这个重启,并不好,在nginx.conf有问题时(也许是新加了模块时),并未真正重启,还是用nginx/sbin/nginx -c nginx.conf吧。当然停止用nginx/sbin/nginx -s stop
还是觉得,只是上网找别人写的例子,不够。尤其有的人写的太短,根本没说明白怎么样一步一步地修改,安装,有些人写的太长,扯来扯去的,找不出骨架。
我写的也不好。。。。所以写个技术文档,不是个容易的活。。。
相关文章推荐
- linux源码安装php,nginx配置php
- wdOS系统下源码编译安装LNAMP(linux+nginx+apache+mysql+php)
- Linux下最新版php5.6源码安装与apache/nginx集成教程
- lnmp源码编译安装Linux(6.4)+Nginx(1.4.1)+Mysql(5.6.12)+Php(5.5.0)
- 图解Linux下源码安装PHP7.0.9 +Nginx
- Linux+Nginx+MySql+Php既LNMP源码安装
- LNMP(linux+nginx+mysql+php)源码安装及协调配置测试笔记
- Linux(6.4)+Nginx(1.4.1)+Mysql(5.6.12)+Php(5.5.0)源码编译安装 推荐
- 源码编译安装,搭建LNMP环境(Linux+Nginx+MySQL+PHP)
- Linux下最新版php5.6源码安装与apache/nginx集成教程
- linux 源码包安装LNMP(linux+nginx+mysql+php)服务器环境
- Linux(6.4)+Nginx(1.4.1)+Mysql(5.6.12)+Php(5.5.0)源码编译安装(参考)
- Linux(6.4)+Nginx(1.4.1)+Mysql(5.6.12)+Php(5.5.0)源码编译安装 环境介绍
- linux环境下源码安装nginx,并搭建PHP 环境
- Linux+Nginx+MySql+Php既LNMP源码安装
- linux源码编译安装php,nginx,git需要的依赖安装脚本
- LNMP架构的搭建(linux+nginx+mysql+php源码安装 )+Discuz论坛的搭建
- Linux下源码方式安装Nginx和PHP(FastCGI)
- linux下php源码安装(nginx服务器篇)
- Linux安装配置PHP+Nginx