4配置文件
# cp php.ini-development /usr/local/php/lib/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
5修改php-fpm配置文件
php-fpm配置文件位置:(/etc/php-fpm.d/www.conf)
? 修改
user =www-data
? group=www-data
三、配置nginx解析php
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
在/usr/loca/nginx/html/test.php
<?php
phpinfo();
?>
重启nginx /use/local/sbin/ -s reload
启动php /usr/local/php/bin/php-fpm
四 、访问http://192.168.3.81/test.php