1. rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm  
  2. yum -y install nginx  
  3. yum -y php-fpm  
  4. service php-fpm restart  
  5. service nginx restart  
  6. chkconfig php-fpm on  
  7. chkconfig nginx on 
    1. server {  
    2.     listen       80;  
    3.     server_name  localhost;  
    4.     autoindex    on;  
    5.     #charset koi8-r;  
    6.     #access_log  /var/log/nginx/log/host.access.log  main;  
    7.     location / {  
    8.         root   /var/www/html;  
    9.         index  index.html index.htm index.php;  
    10.     }  
    11.     location ~ \.php$ {  
    12.         root           /var/www/html;  
    13.         fastcgi_pass   127.0.0.1:9000;  
    14.         fastcgi_index  index.php;  
    15.         fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;  # $document_root
    16.         include        fastcgi_params;  
    17.     }.... 

 

vi /var/www/html/index.php

<?php
phpinfo();
?>

相关文章:

  • 2022-01-11
  • 2022-12-23
  • 2021-08-29
  • 2022-02-23
  • 2022-12-23
  • 2021-07-11
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2021-06-15
  • 2021-07-19
  • 2021-09-29
  • 2022-01-18
  • 2021-12-05
  • 2021-12-27
相关资源
相似解决方案