zoukankan      html  css  js  c++  java
  • Ubuntu9.10下Nginx+PHP(Fastcgi) 安装过程

    1 安装Nginx

    sudo apt-get install nginx

    2 安装php

    sudo apt-get install  php5-cgi

    3 安装spawn-fcgi

    (网上很多文章说要装lighttpd,然后在启动中关闭掉。其实是不需要的)

     sudo apt-get install  spawn-fcgi

     4 启动fastcgi进程

    /usr/bin/spawn-fcgi.standalone -a 127.0.0.1 -p 9000 -C 8 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

    (此处最好为spawn-fcgi.standalone,很多文章只是说使用/usr/bin/spawn-fcgi,但经查,spawn-fcg连接 至/etc/alternatives/spawn-fcgi,且该文件又链接回/usr/bin/spawn-fcgi.standalone,故直接 使用)

    如果需要自动开机启动将上面的东东加到/etc/rc.local中

    5 修改nginx的配置文件:/etc/nginx/sites-available/default

    去掉下面部分的注释:
    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;

     6 重新启动nginx:
    sudo /etc/init.d/nginx restart

     7 写个php文件测试

    < ?php phpinfo();?>

    如果一切顺利应该 就能看到啦。

  • 相关阅读:
    LDD3 第7章 Time,Delays and Deferred Work
    4412 gpio读取pwm
    LDD快速参考
    4412 4路pwm输出
    PCB六层板学习(一)
    STM32 TIM3 PWM输出 4路
    4412 学习目录总结
    4412 Linux定时器
    4412 SPI驱动
    4412 i2c驱动
  • 原文地址:https://www.cnblogs.com/goodspeed/p/1698609.html
Copyright © 2011-2022 走看看