Different PHP in a sub directory


Hello everyone… I’m using PHP 7.4 for the majority of my website, but I would like to use PHP 5.6 in one of the subdirectories. So I’ve set up that sub directory to use 5.6 but it doesn’t seem to work. What am I doing wrong here?


Usually you should omit specifying public_html/ part, as the actual path should be relative to document root.

1 Like

I’ll give that a try! Thank you!

Dan Lewis

It worked!!! Thank you very much!

Dan Lewis

1 Like

Could we make this uniform please, for the convenience of all? In Virtualmin → Server Configuration → Edit Proxy Website we need to include public_html, see the second screenshot in:

No, these are completely two different application cases, and inclusion of “public_html” on Server Configuration ⇾ Website Options page is actually a definition of a directory that contains web content. By the way, I wouldn’t use it the way you do.

Yes, I see your point about including public_html automatically and implicitly where web content can be assumed.

My intent was not to do anything risky, if you could expand (in the original thread) upon a different and better way, we would all be grateful.

The best solution is an accepted answer – you should use subdomains, rather than changing document root. I assume you could as well use re-writes or proxy pass but this is like scratching your right ear with the back of your left hand while reaching from behind of your head.

That makes perfect sense, thanks @Ilia.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.