0

I have a ftp server with two sites on in it:

site.com <-a different CMS needs php7.1 site.com/shop/ <-a different CMS needs php8.0

One of these works with php7.1 and the other with php8.0. Is it possible to make these two versions cohabit together? The two sites are totally separated (despite the fact that they are in the same domaine. The sites are hosted on a OVH server.

This solution is not working for subfolders: Implement two php versions on the same ovh ftp Only for root domains. And I need a solution that works for subfolders.

I tried this solution, but it is not the same problem: Implement two php versions on the same ovh ftp

  • This is not possible without using redirection. You can set one and only one version of PHP per multisite. Cf https://docs.ovh.com/gb/en/hosting/configuring-file-ovhconfig/ – Pierre Mar 03 '23 at 09:11
  • By rederection, what do you mean? I have read that file many times. I am looking for some out of the box solution. I could set a pho to 7.3 with the same environment 'stable' to one subdomain and 7.1 to the other but not to subfolders. Can I somehow use two severs for one domain? – Ryszard Kaczorowski Mar 04 '23 at 10:27

1 Answers1

0

Running two separate versions of PHP at the same time without containerization is always a pain and I would strongly recommend against it. Doing so on the same domain, even more so. You've got a few options that I can think of, in order of increasing preference:

  • You could use the suggested solution to run three separate sites: main.site.com, shop.site.com, and site.com. The first runs your site on 7.1, the second runs your shop on 8, and the third is just a proxy that maps site.com/shop to shop.site.com and everything else to main.site.com. This allows you to keep the shop on the main domain.
  • If keeping the shop on the main domain is not important, you could use the suggested solution to run a second server on a subdomain like shop.site.com and then just have the first server 302 redirect site.com/shop there.
  • Forget trying to fiddle with having multiple versions of PHP active at the same time and just provision a second VPS. Put site.com on VPS 1 and shop.site.com on VPS 2 and 302 redirect site.com/shop to VPS 2.
  • Update the main site so that it runs on 8. Rector is great for helping with this. You should do this anyway, considering that 7.1 was end-of-lifed over three years ago.
Alex Howansky
  • 50,515
  • 8
  • 78
  • 98