nginx和php配置

1、安装

yum install php

yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc

php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash

libmcrypt

1.1、启动php-fpm了

service php-fpm start

使用如下命令来验正(如果此命令输出有中几个php-fpm进程就说明启动成功了)

ps-ef |grepphp-fpm

如果出现

Failed to start php-fpm.service: Unit php-fpm.service failed to load: No such file or directory.

安装yum  php-fpm

2、nginx配置中更改


location ~ \.php$ {

root          html;

fastcgi_pass  127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;

include        fastcgi_params;

}

你可能感兴趣的:(nginx和php配置)