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 逻辑谓词和消解原理的运用
  • ¥15 请求分析基于spring boot+vue的前后端分离的项目
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?