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 !

图片转代码服务由CSDN问答提供 功能建议

:D

无法通过在Google上搜索小时找到我想要的内容 。

任何人都知道如何在安装了Apache 2.4的Windows上安装多个PHP版本以及如何在vhosts上选择版本?

谢谢!

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

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 !

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • douqianzha6213 2017-05-16 09:31

    It is possible to do that. You should use PHP as an Apache module, and in each vhost configuration, you can define which PHP version to use.

    You can find out more here or you could also check out this site for a detailed answer.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题