nginx +php 环境搭建之php安装
?
感谢您选择使用ERMEB域名授权离线网络验证系统(简称:ERMEB域名授权系统)是ERMEB团队开发,ERMEB域名授权系统是国内最稳定,最强大,最先进的域名授权管理平台解决方案之一,ERMEB域名授权系统采用PHP +Mysql的技术,ERMEB域名授权系统框架使用Thinkphp6/mysql数据库基于Markdown开发者文档开发而成,项目安装请参考ThinkPHP官方文档及下面的服务环境说
立即学习“PHP免费学习笔记(深入)”;
安装php-5.4.4
?
立即学习“PHP免费学习笔记(深入)”;
# tar -jxvf php-5.4.4.tar.bz2 # cd php-5.4.4 # ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --enable-fpm --enable-sockets --enable-sysvshm --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-libxml-dir=/usr --enable-xml --with-mhash --with-mcrypt --with-config-file-path=/etc/php --with-config-file-scan-dir=/etc/php --with-bz2 --with-curl # make # make install 复制主配置文件 # cp php.ini-production /etc/php.ini 服务脚本 # cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm # chmod +x /etc/rc.d/init.d/php-fpm 修改php-fpm配置文件 # cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf # vim /usr/local/php/etc/php-fpm.conf pid = run/php-fpm.pid pm.max_children = 50 最多多少子进程 pm.start_servers = 5 刚开始启动多少进程 pm.min_spare_servers = 2 最少多少空闲进程 pm.max_spare_servers = 8 最多多少空闲进程 <span>#?service?php-fpm?start </span>
?编辑/etc/nginx/nginx.conf,启用如下选项:
?
立即学习“PHP免费学习笔记(深入)”;
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_params;
}
?
立即学习“PHP免费学习笔记(深入)”;
编辑/etc/nginx/fastcgi_params,添加修改如下内容:
?
立即学习“PHP免费学习笔记(深入)”;
fastcgi_param? SCRIPT_FILENAME??? $document_root$fastcgi_script_name;
?
立即学习“PHP免费学习笔记(深入)”;
添加php格式的主页,如下所示:
location / {
??????????? root?? html;
??????????? index? index.php index.html index.htm;
??????? }
???????
重启服务:
# service nginx restart
写入测试文件,访问查看
?
立即学习“PHP免费学习笔记(深入)”;
?
立即学习“PHP免费学习笔记(深入)”;










