skip to Main Content

I have multiple projects based on PHP. Some require PHP version 5.x to run and other strictly require PHP 7.0 or above. I am working on these simultaneously. Is there a way to run multiple PHP versions such that I can switch between them when working on different projects.

2

Answers


  1. Try these steps:

    1. Stop LAMP if running.

    Download libphp7.so if you don’t have

    https://github.com/prashant-techindustan/php7module_library/blob/master/libphp7.so

    1. Edit /opt/lampp/etc/extra/httpd-xampp.conf (Comment out one of the following which is not needed):

      LoadModule php5_module modules/libphp5.so

      LoadModule php7_module modules/libphp7.so

    2. Start LAMP

    Login or Signup to reply.
  2. >> Open C:xamppapacheconfextrahttpd-xampp.conf
    >> Write Following code at Bottom of this (httpd-xampp.conf) file
    
        ScriptAlias /php56 "C:/xampp/php56"
        <Directory "C:/xampp/php56">
            AllowOverride None
            Options None
            Require all denied
            <Files "php-cgi.exe">
                Require all granted
            </Files>
        </Directory>
    
    >> Open C:xamppapacheconfextrahttpd-vhosts.confhttpd-vhosts.conf
    >> Create a virchual host in Different post By Writing Following code
    
        <VirtualHost *:8081>
            UnsetEnv PHPRC
            <FilesMatch ".php$">
                php_flag engine off
                SetHandler application/x-httpd-php5_6
                Action application/x-httpd-php5_6 "/php5_6/php-cgi.exe"
            </FilesMatch>
            DocumentRoot "C:/xampp/htdocs/myphp5_6_project"
        </VirtualHost>
    
    >> Create a folder "myphp5_6_project" in htdocs of xampp
    >> Open C:xamppapacheconfhttpd.conf
    >> Write Listen 8081 (any where or Below Listen 80 line)
    >> Restart Apache Services
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search