Various "LoadModule php5_module" instructions for apache virtual hosts

I have apache2 and php5.2 installed as a module in httpd.conf:

LoadModule php5_module "c:/php/php5apache2_2.dll"
PHPIniDir "C:/php/"

Also I have php5.3 in the C: / php53 folder.

Can I use different modules for different virtual hosts?

Now I need to change the LoadModule and PHPIniDir instructions and restart apache.

+3
source share
1 answer

I am sure that you cannot load two versions of PHP in apache at the same time. However, you can use two different versions of PHP using mod_fcgid.

Windows, , . FastCGI PHP http://fuzzytolerance.info/blog/apache-mod_fcgid-and-php-on-windows/

, . FCGI , VirtualHost

:

<VirtualHost *:80>
  ServerName site1
  ServerAdmin admin@site1
  DocumentRoot "c:/www/site1"

  <Directory "c:/www/site1/web">
    Options +ExecCGI
    AllowOverride All

    ## FastCGI stuff
    AddHandler fcgid-script .php
    FcgidInitialEnv PHPRC "c:/php52"
    FcgidWrapper "c:/php52/php-cgi.exe" .php
    AddType application/x-httpd-php .php

    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

FcgidInitialEnv PHPRC, , php.ini, FcgidWrapper php-cgi.exe PHP.

VirtualHost, PHP. PHPRC , .

+1
source

Source: https://habr.com/ru/post/1795959/


All Articles