Close

Making Joomla 1.0 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.

 

33 thoughts on “Making Joomla 1.0 work on PHP 5.3.x

  1. Hi- first off- I apologize for how green I am on Joomla, but I am in a crunch and hoping some kind, intelligent person out there can help me! I have no budget to play with and I’ve been trying for a few days now to figure it out myself! I would be honestly greatful for your time.

    I used joomla to build a site in 2007 for a small nonprofit organization and have not updated the version of joomla since then and never needed to for the purposes of our organisation. However, i am using godaddy as my host and when they updated their php in august my site failed and had heaps of deprecated messages everywhere. I will remake a website (and reteach myself) if necessary, but I don’t know where to find all the information that I had on the website before and of course I never did a backup before I upgraded my php version. While following a tutorial that sounded similare to my problem I changed some code in my joomla/includes/Cache/Lite/Function.php on line 83 (I actually copy and pasted the code that was said to help and erased all the previous code.) This didn’t work for me…
    So what I need help with is:
    1) I have no idea what the original code would have been for joomla/includes/Cache/Lite/Function.php and where to find it somewhere else on the net.
    2) Where can I find all my content. I had at least 8 pages about conferences, different schools and such… but when I try to find them going in as an administrator or webmaster I have no luck because I have that coding problem and when I look at the ftp section on godaddy I havn’t found them anywhere. (I also need to find e-mail address of those who signed up on the site to use the forum and such…) I’m praying that it’s still there somewhere…

    Thank-you kindly for your time and my fingers are crossed!
    Becky

    1. Hi Becky, Sorry to hear about your problem. Can you confirm that your Joomla version is 1.0.15? If you want a copy of my Function.php file I can send put a version online for you to download.
      In relation to your content is this invisible in the administrator as well? If it’s all caused by the php 5.3 problem I think a new Function.php will help. Either way your content and users should still be in the database (in tables jos_content and jos_users). Let me know and I can upload the file for you.

        1. CMS Bloke, this is AWESOME. I tried to use php 5.3 on my new server, but my joomla sites died. No that i used your Function.php files, im going to give it a try again.

          Thanks

  2. Hey CMS Bloke! 🙂 I wish you could feel the wave of relief and happiness that I just got after replacing my Function.php with the code you uploaded for me so conveniently. Thank-you so much for helping me and so quickly. I really love community and I am going to begin to learn about the Joomla community after reading all the information out there from the past few days.

    ** I have another really simple minded question that I’m not sure about and don’t want to mess everything up now. When people type in my website “mysite.com” they come to mysite.com/joomla. I know it’s because I have the folder in a folder/layer below, but will I be able to move everything out of my folder and put it in the html folder without breaking code? What would you recommend?? Or should I just leave it as is…

    Thanks again!
    Becky

    1. Hi Jason, Is it Joomla 1.0 or 1.5. This trick is for 1.0.15 only. The later joomlas should work on 5.3 from version 1.5.15 or so upwards.

  3. Thanks so much! That did it! My provider helped with some problems due to their PHP upgrade, but Joomla was up to me.

    I realize it’s best to upgrade to the latest version, but I’m kind of worried about having to edit templates, etc, that I’ve spent so much time on getting just right.

  4. Does anyone know Joomla 1.0 will work on mysql 5.5? I just got a notice from my host they are upgrading from 5.2 in a few days. thanks

    1. Hi Tim, yes it should work fine with 5.5 I think. I doubt it would be installable on 5.5 without edits to the .sql file because of keyword deprecation (Like the “engine”, “type” issue) – but I doubt it would stop working on an existing site. Even so – 1.0 is quite old at this stage 😉

  5. To bad I didn’t know about this little tweak… like …two years ago… 😉
    But still… Today this takes of a very great deal of pressure!!!!! 🙂
    THANKS!!!

  6. Your solution fixed some of the “deprecated” errors, but I still get a few:

    Deprecated: Function eregi() is deprecated in […]/public_html/includes/pathway.php on line 280
    Deprecated: Function eregi() is deprecated in […]/public_html/includes/pathway.php on line 313

    Any idea how to fix those please? Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.