PHP致命错误:调用未定义的方法mosMenu :: mosDBTable()

问题描述:

我有一个Mambo CMS网站托管与000webhost。该网站由Mambo 4.6.2提供支持。和PHP Version 5.2.13安装在000webhost Web服务器上。该网站运行良好。PHP致命错误:调用未定义的方法mosMenu :: mosDBTable()

自从我上次在网站上工作并且该网站不再有效后,我已将我的开发计算机的操作系统升级到Ubuntu 10.04。本机已安装PHP版本5.3.2-1ubuntu4.2

我谷歌搜索'PHP致命错误:调用未定义的方法mosMenu :: mosDBTable()',这导致我这thread on the Mambo Forums

上面的线程建议在php.ini中使用以下设置:error_reporting = E_ALL | ~E_STRICTzend.ze1_compatibility_mode true。我想这一点,其产生17个附加错误:

PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/index.php on line 170 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/index.php on line 270 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/index.php on line 323 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/index.php on line 328 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/database.php on line 777 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 407 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 426 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 533 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 1148 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 1676 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2615 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2621 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2627 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2633 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2639 
PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2668 
PHP Deprecated: Function ereg_replace() is deprecated in /home/mike/Public/mambo/includes/core.classes.php on line 2978 
PHP Fatal error: Call to undefined method mosMenu::mosDBTable() in /home/mike/Public/mambo/includes/core.classes.php on line 897 

相同的代码运行而不000webhost的服务器上的错误(其中也有PHP 5安装)。我想知道的是,是否可以配置PHP 5/Apache 2来运行不推荐使用的代码,而无需编辑代码本身?

谢谢,
迈克

+0

你也应该有问题的代码发布:) – Sarfraz 2010-08-21 20:51:25

这可能不是最适合你的答案,但我不会考虑阅读this topic后使用曼波了。

这个人“andphe”是Mambo项目的管理员和程序员,他建议OP更改error_reporting设置。任何值得他们的盐的PHP程序员都不会期望这能够修复致命错误,因为所有error_reporting都会隐藏这些消息。如果你有一个致命错误,无论错误报告级别是什么,你的代码仍然无法工作。您将无法看到错误消息。

像这样的错误对项目灌输不信任。我将继续使用另一个CMS,如Joomla(这是Mambo的一个分支)或Drupal,可以说是当今最流行的基于PHP的CMS。

+0

是的,所有文件的权限/文件夹递归设置为777 昨天,我试图运行使用最新版本的XAMPP的Windows XP上的项目,这导致'PHP致命错误:调用未定义的方法mosMenu :: mosDBTable()错误'。 回到Ubuntu,我从Sourceforge下载了原始版本'MamboV4.6.2.tar.gz',并建立了一个全新的网站。安装过程已成功完成,但安装后尝试访问网站时出现相同的错误。 ... – unpossible 2010-08-22 20:33:16

+0

我也从我的网络主机上下载了(工作)网站,并在Ubuntu上进行了设置,它在上面生成了相同的17个错误。 由我的开发服务器上的PHP 5的配置引起的问题,特别是'error_reporting'指令? '/etc/php5/apache2/php.ini'中的默认设置是'error_reporting = E_ALL&〜E_DEPRECATED'。我将它改为'error_reporting = E_ALL&〜E_NOTICE',但仍然没有喜悦。 我不知道下一步该做什么。任何指针将是最受欢迎的。 – unpossible 2010-08-22 20:33:47

+0

@mej阅读我更新的答案 – NullUserException 2010-08-22 20:54:33