zoukankan      html  css  js  c++  java
  • windows下更改Apache以fastcgi方式运行php

    Apache 默认 apache2handler 方式运行处理php.

    下面说切换方法:
    1、下载fastcgi模块,打开https://www.apachelounge.com/download/选择相应的VC版本下载,我的使用VC14编译的,所以选的是VC14版本
    2、下载解压后,将mod_fcgid.so文件复制到Apache的安装路径modules目录中
    3、打开配置文件httpd.conf,添加以下代码

    LoadModule   fcgid_module modules/mod_fcgid.so
    <IfModule fcgid_module>
        FcgidIOTimeout 60
        FcgidConnectTimeout 30
        FcgidMaxProcesses 8
        FcgidOutputBufferSize 64
        ProcessLifeTime 240
        FcgidMaxRequestsPerProcess 500
        FcgidMinProcessesPerClass 0
    
        Options ExecCGI
        AddHandler fcgid-script  .php 
        #你项目php安装目录
        FcgidWrapper "D:/wamp/bin/php/php7.0.23/php-cgi.exe" .php
    </IfModule>

    这个时候重启Apache就已经切换完成了 
    不过我配置了虚拟主机,所以还得对虚拟主机做更改 
    4、原虚拟主机配置

    <VirtualHost *:80>
         ServerName myphalcon.com
         ServerAlias myphalcon.com
         DocumentRoot "${INSTALL_DIR}/www/myphalcon/public"
         <Directory "${INSTALL_DIR}/www/myphalcon/public/">
           Options +Indexes +Includes +FollowSymLinks +MultiViews
           AllowOverride All
           Require local
         </Directory>
    </VirtualHost>

    更改后(ExecCGI就是刚才配置的Options)

    <VirtualHost *:80>
         ServerName myphalcon.com
         ServerAlias myphalcon.com
         DocumentRoot "${INSTALL_DIR}/www/myphalcon/public"
         <Directory "${INSTALL_DIR}/www/myphalcon/public/">
           Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride All
           Require local
         </Directory>
    </VirtualHost>

    如果需要设置成不同的php版本,可以在模块中添加

    FcgidWrapper "D:/wamp/bin/php/php5.6.31/php-cgi.exe -c D:/wamp/bin/php/php5.6.31/phpForApache.ini" .php

    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        #Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require local
        FcgidWrapper "D:/wamp/bin/php/php5.6.31/php-cgi.exe -c D:/wamp/bin/php/php5.6.31/phpForApache.ini" .php
      </Directory>
    </VirtualHost>

    5、重启Apache 

    转: https://blog.csdn.net/u014691098/article/details/80159574

  • 相关阅读:
    mac系统xcode升级等软件更换appid账户
    touch id 开发
    iOS自动化编译
    cocopods 知识集合 及 一个 好的 国外iOS技术翻译站
    cocoapods 更新失败 bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)
    iOS流量监控
    火星信息安全研究院
    Xcode6.1标准Framework静态库制作方法。工程转Framework,静态库加xib和图片。完美解决方案。
    Linux各目录及每个目录的详细介绍
    Linux du命令
  • 原文地址:https://www.cnblogs.com/fps2tao/p/11684562.html
Copyright © 2011-2022 走看看