上传软件至/opt目录
1、编译nginx
解压并编译
#cd /tmp/nginx-1.13.0&&./configure --prefix=/usr/local/nginx-1.13.0 --with-http_ssl_module --with-pcre
#make && make install
添加nginx为系统服务
内容如下
2、配置PHP
#cp ?/tmp/php-7.1.4/php.ini-production /usr/local/php-7.1.4/etc/php.ini#cp /usr/local/php-7.1.4/etc/php-fpm.conf.default /usr/local/php-7.1.4/etc/php-fpm.conf#cp /usr/local/php-7.1.4/etc/php-fpm.d/www.conf.default /usr/local/php-7.1.4/etc/php-fpm.d/www.conf
vi /usr/local/php-7.1.4/etc/php.ini
参数改为以下数值:
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
date.timezone = PRC
启动,重启,终止操作
启动
#/usr/local/php-7.1.4/sbin/php-fpm
查看master进程
3、关联nginx和php
worker_processes 2; 修改工作时的核心数error_log logs/error.log; 打开日志功能error_log logs/error.log notice;error_log logs/error.log info;pid logs/nginx.pid;events { use epoll; worker_connections 65530;}
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/nginx-1.13.0/html$fastcgi_script_name; 此处加上nginx的目录路径 include fastcgi_params; }
原文地址:http://blog.51cto.com/12131824/2105513