A
A
AstonMartin2017-05-08 10:17:11
PHP
AstonMartin, 2017-05-08 10:17:11

How to install a different version of php in a subfolder?

Good day everyone!
There is a server on CentOS Linux release 7.2.1511 (Core)
Installed nginx 1.10.2 as a proxy and apache + mod_php 5.6. The site site.ru is spinning on the simple machines engine. I want to put yii2 with php 7.1 with php-fpm in the site.ru/folder/ subfolder. Is it possible? There is no way to remove Apache at all (there are a lot of complex htaccess). It is also not possible to transfer the entire server to php 7. The site does not support the old engine there.
Please tell me the correct sequence of actions so that php 7 works in site.ru/folder/ and other sites do not break.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Ukolov, 2017-05-08
@AstonMartin

Please tell me the correct sequence of actions

  • Profit!
  • O
    OnYourLips, 2017-05-08
    @OnYourLips

    There are many ways: AddHandler application/x-httpd-php71 .php, mod_fcgid, mod_proxy, allocate a virtual machine for another site, OS-virtualization like docker.
    But there is another way, and in my opinion it is the best.
    I would install nginx, and transfer the old apache to another port, and in nginx for the domain of the old site I would set up proxy_pass for php and direct return for statics.
    This is a common practice, moreover, it will increase its performance.

    I
    Ilya, 2017-05-08
    @rpsv

    Like AddHandler option in .htaccess :
    Source: stackoverflow.com/questions/12561203/how-to-change...

    A
    AstonMartin, 2017-05-09
    @AstonMartin

    I tend to raise the second virtual only php-fpm (even without nginx) and proxy requests there from the /folder/ location from the first server.
    Are there pitfalls here?

    Didn't find what you were looking for?

    Ask your question

    Ask a Question

    731 491 924 answers to any question