简体   繁体   中英

Is it possible to use multiple version of php in different directory in apache?

I would like to use 2 php versions on same domain is it possible ?

http://www.example.com -> php 5

http://www.example.com/newphp -> php7

and how?

I'm using Centos 6x

Thank you.

Yes it's possible with PHP-FPM, but not out of the box, as far as I know. You will have to do some compiling from source, and then some fancy Apache configuration. I can point you to an internet resource to get you started, but be aware this is not a task for the inexperienced.

The basic steps to compile PHP-FPM and Apache on CentOs are described in the first part of this tutorial:

https://www.howtoforge.com/how-to-build-php-5.6-fpm-fastcgi-with-zend-opcache-and-apcu-for-ispconfig-3-on-debian-7-wheezy

You can install a second PHP-FPM version the same way you installed the first, and then configure which PHP pool you want to use in your Apache config or .htaccess files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM