dtch60248 2017-05-16 07:54
浏览 87
已采纳

多个PHP版本没有WAMP / XAMPP

:D

Impossible to find what I want by searching hours on google.

By any chance, does anyone know how to set up multiple PHP versions on a Windows install with Apache 2.4 on it and how to choose version on vhosts ?

Thanks !

  • 写回答

2条回答 默认 最新

  • dsfhe34889789708 2017-05-17 10:13
    关注

    Okay so I figured out the problem !

    In my Apache httpd.conf

     LoadModule fcgid_module /server/Apache-2.4/modules/mod_fcgid.so
    
    <IfModule fcgid_module>
        FcgidInitialEnv PATH "C:/server/php-5.6-nts/php.ini;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
        FcgidInitialEnv SystemRoot "C:\Windows"
        FcgidInitialEnv SystemDrive "C:"
        FcgidInitialEnv TEMP "C:\Windows\Temp"
        FcgidInitialEnv TMP "C:\Windows\Temp"
        FcgidInitialEnv windir "C:\WINDOWS"
        FcgidIOTimeout 1200
        FcgidConnectTimeout 1200
        FcgidBusyScanInterval 1200
        FcgidBusyTimeout 1200
        FcgidErrorScanInterval 1200
        FcgidIdleScanInterval 1200
        FcgidIdleTimeout 1200
        FcgidProcessLifeTime 3600
        FcgidZombieScanInterval 1200
        # Location php.ini:
        FcgidInitialEnv PHPRC "C:/server/php-5.6-nts"
        FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
    
        <Files ~ "\.php$">
            Options Indexes FollowSymLinks ExecCGI 
            AddHandler fcgid-script .php
            FcgidWrapper "C:/server/php-5.6-nts/php-cgi.exe" .php
        </Files>
    </IfModule>
    
    <IfModule mime_module>
        AddType application/x-httpd-php .phps
        AddType application/x-httpd-php .php3
    </IfModule>
    

    Then in my vhost config :

    <VirtualHost *>
      ServerName xxx.xxx
      DocumentRoot "C:/www/xxx"
          AddHandler fcgid-script .php 
          FcgidInitialEnv PHPRC "/server/php-5.2-nts" 
        <Directory "C:/www/xxx"> 
            AllowOverride All
                order allow,deny 
                allow from all 
                deny from none 
                Require all granted
            <Files ~ "\.php$"> 
                AddHandler fcgid-script .php 
                FcgidWrapper "/server/php-5.2-nts/php-cgi.exe" .php 
                Options +ExecCGI 
                order allow,deny 
                allow from all 
                deny from none 
                Require all granted
            </Files> 
        </Directory>
    </VirtualHost>
    

    Now I can declare whatever PHP version I want !

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 软件定义网络mininet和onos控制器问题
  • ¥15 微信小程序 用oss下载 aliyun-oss-sdk-6.18.0.min client报错
  • ¥15 ArcGIS批量裁剪
  • ¥15 labview程序设计
  • ¥15 为什么在配置Linux系统的时候执行脚本总是出现E: Failed to fetch http:L/cn.archive.ubuntu.com
  • ¥15 Cloudreve保存用户组存储空间大小时报错
  • ¥15 伪标签为什么不能作为弱监督语义分割的结果?
  • ¥15 编一个判断一个区间范围内的数字的个位数的立方和是否等于其本身的程序在输入第1组数据后卡住了(语言-c语言)
  • ¥15 Mac版Fiddler Everywhere4.0.1提示强制更新
  • ¥15 android 集成sentry上报时报错。