How Can One Run Multiple Versions of PHP 5.X on a Development Lamp Server

How can one run multiple versions of PHP 5.x on a development LAMP server?

One way to do this is to have your main version of php set up with mod_php and run all of the others through fast cgi on different ports (i.e. 81, 82, 83 etc). This won't guarantee totally consistent behavior though.

how to check if there are multiple versions of php in windows10 need 7.1 for laravel packages?

You get 5.6, because it set in your PATH system variable.

If you need an additional 7.0, you could download it and use full path to php.exe to execute it.

Example:

C:\php7\php.exe -v

Or you could change PATH to php 7 directory. Then you will be able to run it with only php command. In this case, to run php 5.6 you will have to use full path to it. Don't forget to logout/reboot the system to apply the PATH variable changes.

Set only one version of php to PATH because system runs the first founded php.exe, in your case this is php 5.6.

Run php5 and php7 in parrallel

If your operating system is ubuntu, then you can set up multiple instances of Apache, one to run PHP 5 and the other to run PHP 6 according to this article.

Can I have different versions of php installed and running on my server?

Yes you can, one php is run as CGI and other as MODULE.

OR

You could run 2 apache's.
I have apache 1.3.x with php4 on port 82 and apache 2.2.x with php5 on port 80.
In both cases php is run as module.

In both cases I do not recommend this for production server, only for development.

One server, multiple domains, sharing PHP MVC

Configure the Apache virtual host for the main site, and use the ServerAlias directive so it accepts connections for your other domains.

<VirtualHost *:80>
ServerName mysite-england.co.uk
ServerAlias *.mysite-england.co.uk *.mysite-wales.co.uk mysite-wales.co.uk *.mysite-scotland.co.uk mysite-scotland.co.uk
DocumentRoot /www/mysite
</VirtualHost>

More information:

  • http://httpd.apache.org/docs/2.0/vhosts/name-based.html
  • http://httpd.apache.org/docs/2.0/mod/core.html#serveralias

PHP Files shown as Plaintext in Apache2 LAMP Machine

RIP GUYS.

I just show it. I set the header to text/plain.

If you remove the header all works fine:

header('Content-type: text/plain; charset=utf-8');

..or if we change it to text/html.



Related Topics



Leave a reply



Submit