dpjr86761 2019-06-26 08:06
浏览 197

多个托管网站,在cPanel中为所有人设置PHP版本,覆盖一个需要早期版本但不起作用的网站

We have an old legacy PHP website that won't run on PHP greater than 5.4. It's on a shared hosting server with GreenGeeks.com and we have a cPanel 11 to control all our hosted sites. We've had to keep the default PHP level at 5.4 purely to keep this one legacy site running (there are multiple errors with > 5.4), but that can't go on, we need to upgrade the default PHP to the latest version.

Default PHP version

Rewriting the legacy site isn't really an option unfortunately. I thought that if we set PHP level up to latest and add a directive in the .htaccess then that would work, so I've tried adding this into the .htaccess for the legacy site at the top of the file:

AddHandler application/x-httpd-php54 .php

And a number of other variations (I don't know much about htaccess) and the site still runs okay with them added, but as soon as I change the default PHP level for the entire platform to something higher I get this:

Error page

So my question is, is it possible in such a setup to have one website running PHP 5.4 and all the others running, say 7.2? And if so, what am I doing wrong?


Edit

I contacted GreenGeeks support and they inform me that only one PHP version can run per cPanel account, so overrides in .htaccess simply don't work.

If anyone has any workarounds that would be great but I think this is simply not possible.

  • 写回答

1条回答 默认 最新

  • doucan2102 2019-06-26 08:12
    关注

    That setting is per account. If you change to php 5.4 all website hosted on that account will use php 5.4. My advice is to hire someone to update your code from that old website to be able to use php 7.0 or higher.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog