Is it possible to run a different PHP in a particular folder?

4

I have a problem:

The server uses PHP 5.3, which is very old but can not be changed. I have a script that requires PHP 5.4 +, is the Ratchet websocket. Is it possible to install a separate PHP to be used only in the folder where this script is located?

    
asked by anonymous 24.01.2017 / 17:53

1 answer

2

You can install more than one version on the same server.

After installing the two versions of PHP, in Apache configuration, in httpf.conf you can configure an extension for each version:

AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php # the default

It is also possible to make an entire folder use a specific version by changing .htaccess , in the folder you want to run in a different version by specifying the desired version.

AddType application/x-httpd-php4 .php

Source: link

    
29.01.2017 / 21:02