views:

49

answers:

1

I have a Mambo CMS web site hosted with 000webhost. The site is powered by Mambo 4.6.2. and PHP Version 5.2.13 is installed on the 000webhost web server. The web site runs fine.

I've upgraded the OS of my development machine to Ubuntu 10.04 since I last worked on the site, and the site no longer works. This machine has PHP Version 5.3.2-1ubuntu4.2 installed.

I Googled 'PHP Fatal error: Call to undefined method mosMenu::mosDBTable()', which led me to this thread on the Mambo Forums.

The thread above suggests using following settings in php.ini: error_reporting = E_ALL | ~E_STRICT and zend.ze1_compatibility_mode true. I tried this, which produced 17 additional errors:

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

The same code runs without errors on the 000webhost server (which also has PHP 5 installed). What I'd like to know is, is it possible to configure PHP 5/Apache 2 to run deprecated code without editing the code itself?

Thanks,
Mike

A: 

This might not be the best answer for you, but I would not consider using Mambo anymore after reading this topic.

That guy "andphe" is an admin and programmer for the Mambo project, and he recommended the OP to change error_reporting settings. Any PHP programmer worth their salt wouldn't expect this to fix a fatal error, because all error_reporting does is hide the messages. If you have a fatal error, your code will still not work, no matter what the error reporting level is. You just won't be able to see the error messages.

A mistake like that instills no confidence in the project. I would just move on and use another CMS like Joomla (which is a fork of Mambo) or Drupal, arguably the most popular PHP-based CMS nowadays.

NullUserException
Yes, the permissions of all files/folders are recursively set to 777.Yesterday, I tried running the project on Windows XP using the latest version of XAMPP, which resulted in the 'PHP Fatal error: Call to undefined method mosMenu::mosDBTable()error'.Back in Ubuntu, I downloaded an original copy of 'MamboV4.6.2.tar.gz' from Sourceforge and set up a brand new web site. The installation process completed successfully, but the same error appeared when trying to access the site after installation....
mejpark
mejpark
@mej Read my updated answer
NullUserException
Alarm bells were ringing when he said "Mambo has been not tested on the new PHP 5.3". It sounded like it was going to turn into a ball ache to ammend the code. But that doesn't explain why the same code runs on 000webhost servers, which also has PHP 5. As frustrating as it is, I think I'll bury this one and move on! I had considered porting site to Joomla!, but I was really looking to leave the project 'as is' for my web portfolio. But I will certainly check out Drupal. Thanks for your input regarding behaviour of error_reporting - useful to know.
mejpark
@mej There were some changes from PHP 5.2.x to 5.3.x, including the deprecation of the `ereg` family of functions, which is one the warnings you see there.
NullUserException
You're absolutely right: http://uk.php.net/manual/en/function.ereg.php <-- I can't believe I missed it. But this exercise wasn't a complete waste of time - I learned something after all. Thanks for your help.
mejpark