yum 一键搭建php环境

yum 一键搭建php环境

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum remove httpd* php*

yum -y install php php-fpm php-gd php-mysql php-mbstring php-xml php-mcrypt mysql mysql-server nginx

service php-fpm start

nginx 配置

location / {
     root /usr/share/nginx/html;
     index index.html index.htm index.php;
}

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;
}

你可能感兴趣的:(yum 一键搭建php环境)