解决MOTOCMS系统更换主机后无法访问的问题(空白页或500 error)

MOTOCMS是一套美国公司开发的商业版CMS(内容管理)系统(它采用Zend加密源代码保护版权),它跟国内的米拓(mituo.cn)开发的CMS系统类似。这2套系统都可以创建多语言的页面(比如中文版/英文版),不同之处在于一个适合老外用,一个适合国人用。

最近需要将一个放在美国VPS上运行MOTOCMS系统的网站搬迁到国内虚拟主机上,文件转移以及数据库备份还原都是简单的操作,最坑爹的是搬迁完无法打开,页面提示:Zend Guard Run-time support missing! 这说明没有安装好Zend Guard,需要切换一个PHP版本环境试试看。

查看了原来VPS配置运行环境:PHP 5.5.38 + Zend Engine v2.5.0 + mysql 5.5.56

而新的虚拟主机环境是:PHP 5.5.30 + 无Zend Engine + mysql 5.7.23

在虚拟机管理后台看了一下可切换的PHP版本如下:

  • PHP5.2
  • PHP5.3
  • PHP5.4
  • PHP5.5
  • PHP5.6
  • PHP7.0
  • PHP7.1
  • PHP7.2

直接尝试切换到了最高版PHP7.2,结果错误变成了500 error或者空白页,这说明Zend Engine已经有了只不过有问题,然后查看了phpinfo信息(页面显示为Zend Engine v3.2.0),那怎么还会无法访问?

一般出现问题要去日志里找答案,翻了一下这个网站,找到了日志文件位于:

  • /mt-content/temp/logs/moto.log
  • /mt-content/temp/logs/php_errors.log

这2个日志文件详细记录了网站安装至今的所有错误日志信息,分别摘取这2个文件中的最新记录各1条如下:

  • 2019-09-08T07:51:48+08:00 WARN (4): require_once(/data/home/vhost007/htdocs/mt-includes/library/Moto/Authentication/AuthenticationService.7.2.php): failed to open stream: No such file or directory {"errno":2,"file":"/data/home/vhost007/htdocs/mt-includes/library/Moto/Authentication/AuthenticationService.php","line":1}
  • [08-Sep-2019 07:51:48 Asia/Shanghai] PHP Fatal error:  require_once(): Failed opening required '/data/home/vhost007/htdocs/mt-includes/library/Moto/Authentication/AuthenticationService.7.2.php' (include_path='/data/home/vhost007/htdocs/mt-includes/library:.:/var/www/php72/lib/php') in /data/home/vhost007/htdocs/mt-includes/library/Moto/Authentication/AuthenticationService.php on line 1

从错误信息中可以看出,程序找不到AuthenticationService.7.2.php这个文件,这看起来是程序判断当前php版本为7.2然后引用了这个文件,可是根本没有这个文件。

进入/mt-includes/library/Moto/Authentication/目录看一下到底有哪些文件,以AuthenticationService开头的如下:

  • AuthenticationService.5.3.php
  • AuthenticationService.5.4.php
  • AuthenticationService.5.5.php
  • AuthenticationService.5.6.php

果然是没有AuthenticationService.7.2.php那个文件,自然也就运行出错了(只不过前台没有报具体的错误需要自己看日志文件)。

既然知道答案了,直接在虚拟主机管理页面将php版本改为5.6试试看吧!

结果答案是:Zend Guard Run-time support missing!

继续改为5.3试试,页面显示空白页或500 error。

死马当活马医,选择唯一可选的5.4,网站正常了……

最终跑动这套MOTOCMS系统的配置是:

PHP 5.4.45 + Zend Engine v2.4.0 (with Zend Guard Loader v3.3) + mysql 5.7.23

上一篇: 修改Mysql表名
下一篇: Apache下htaccess重定向代码

发表评论