Nov
25
2011

Making Joomla work on PHP 5.3.x

OK, so Joomla 1.0.x stream is pretty ancient at this stage but there are still a heck of alot of websites running this as their platform. Now it ran perfectly on php 5 but when 5.3 came out it crashed and burned – as did the then current versions of Joomla 1.5! This was eventually fixed in Joomla 1.5.15, but since support for the 1.0 had been removed the older version never did get an update. Symptoms, pretty bad ones, including a completely blank content area deprecation messages in the apache logs like:

PHP Deprecated:  Function eregi() is deprecated in /var/www/primary/includes/sef.php

PHP Deprecated:  Function eregi() is deprecated in /var/www/primary/modules/mod_mainmenu.php

PHP Deprecated:  Function split() is deprecated in /var/www/primary/modules/mod_mainmenu.php
This is a major problem as many hosters have been upgrading their systems. 5.3 is mainstream now. Here’s how to fix it:

  • Open /includes/Cache/Lite/Function.php
  • Go to line 74, i.e. $arguments = func_get_args();
  • Replace it with this:

$arguments = func_get_args();
$numargs = func_num_args();
for($i=1; $i < $numargs; $i++)
{
$arguments[$i] = &$arguments[$i];
}

  • Save
  • Test

Hopefully your content area is back again.

Note: you really should update your website to a current, secure version of Joomla. These notes are just for those cases where you cannot.

 

7 Comments + Add Comment

  • I can’t believe I’ve been going for years without knowing that.

  • You have noted very interesting points! ps decent website.

  • Just what I needed. Thanks a lot!

    • Glad it helped Ray

  • Superb write up. Remember to keep up the very reliable work.

  • Thanks so much saved me heaps of time

    • Glad it helped

Leave a comment