3

I have 2 different virtual hosts on my apache server. One of them needs php7.x and another need php5.x.

Is it possible to use project-specific PHP versions?

I have tried the following,

Running two PHP versions on the same server

but my apache server crashed saying there's some syntactical error in one of the fpm's config file.

Also I cant follow this solution since It advices to uninstall apache and start over again and I can't do that on a live server.

Is there any way to do this without uninstalling the apache server. Thank you for your suggestions.

2
  • What are your specs? If you need to run it as Apache module, then you need two copies of Apache running on different IP/port combinations. If PHP-FPM is fine, I think you should fix the syntax error rather than drop the solution entirely. Commented Aug 4, 2019 at 14:24
  • Its giving me Syntax error on line 27 of /etc/apache2/conf-enabled/php5.6-fpm.conf which states, Alias /php56-fcgi /usr/lib/cgi-bin/php56-fcgi -socket /var/run/php/php5.6-fpm.sock -pass-header Authorization Commented Aug 5, 2019 at 10:12

1 Answer 1

1

for windows on file httpd-vhosta.conf

<VirtualHost *:80>
    DocumentRoot "d:/server/htdocs/"
    ServerName localhost
    ServerAlias www.localhost

    <Directory "d:/server/htdocs/">
        Require all granted
        <Files ~ "\.php$">
            AddHandler fcgid-script .php
            #FcgidWrapper "d:/server/php/php-5.6.40-Win32-VC11-x64/php-cgi.exe" .php
            FcgidWrapper "d:/server/php/php-7.1.24-Win32-VC14-x64/php-cgi.exe" .php
            Options +ExecCGI
        </Files>
    </Directory>
    ErrorLog "D:/server/apache/logs/error-localhost.log"
    SetEnv APP_ON_LOCAL 1

</VirtualHost>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.