Answer the question
In order to leave comments, you need to log in
How to switch PHP version?
Hello, the subject is actually interesting, there is Apache 2.4, there are several versions of PHP that work like FPM, each on its own port, and there is a bunch of even programs that need to periodically switch the PHP version. All this on CentOS. I wanted to make it so that it is enough to change the same .htaccess in the root of the site and the version has changed, but for some reason it does not work. I did this with nginx, but Apache is needed. Help, I saw something on the Internet - it does not work as it should
Answer the question
In order to leave comments, you need to log in
The results are: phpbrew - not quite suitable, docker is not necessary, nginx is not installed. there are legacy applications that only work with apache.
As a result, apache + fcgid solved the problem and the PHP version was switched simply by changing the line in .htaccess.
Install nginx with different versions of php connected via fastcgi.
You can put Apache before nginx (but why?)
Linux distributions may have a special tool for this. For example, eselect or update-alternatives.
In general, Docker solves such problems quite well (if each stack component is in a separate container).
for such tasks, Docker is a very elegant solution, because if you fence many FPM instances, this will create unnecessary complexity in configuration. You can allocate webroot to the shared volume of the file system, php.ini and others like them for each instance also there so that you can quickly tune, let Apache run there with its settings and the required version of PHP on each docker instance.
Further, at the nginx input, simply proxy_pass, allocating a virtual hostname for each docker instance like
1. ver1.mysite.php56.local
1. ver1.mysite.php70.local
1.
ver1.mysite.php71.local in the host of overly complex configs, gracefully isolate each PHP instance for the required version, and, in principle, debug at the same time
well, essno in the debiloper's computer, drive the required hosts into hosts
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question