Current time: 04-20-2014, 09:32 PM Hello There, Guest! (LoginRegister)

Post Reply 
How to run Mambo 4.5.3 on PHP 5.3.1 ?
05-02-2011, 10:50 AM
Post: #1
How to run Mambo 4.5.3 on PHP 5.3.1 ?
I have a website which runs on Mambo 4.5.3, which runs fine on PHP 5.1.6

I plan to move the website to a new hosting, but the new hosting uses PHP 5.3.1. When I ran the website, I got the following error.


Warning: Parameter 2 to frontpage() expected to be a reference, value given in D:\xampp\htdocs\en\includes\Cache\Lite\Function.php on line 100

When I set the display_errors parameter to 'Off'. the error message disappeared. However, the website does not run normally. Several pics disappear, and some pages doesn't show either.

Furthermore, when I chechked the page source from Firefox, I found that certain PHP lines are not rendered properly. For example, in the new hosting PHP 5.3.1), these PHP lines are NOT properly rendered to HTML.
PHP 5.3.1 does not render the lines properly Wrote:<td><img src="<?=$mosConfig_live_site."/templates/".$cur_template?>/images/menu1.gif"></td>
<td bgcolor="#659331" class="fontMenu" nowrap>Latest News ...</td>
<td><img src="<?=$mosConfig_live_site."/templates/".$cur_template?>/images/menu2.gif"></td>

PHP 5.1.6 renders the lines properly Wrote:<td><img src="http://www.mywebsite/en//templates/BKPPMD/images/menu1.gif"></td>
<td bgcolor="#659331" class="fontMenu" nowrap>Latest News ...</td>
<td><img src="http://www.westjavainvest.com/en//templates/BKPPMD/images/menu2.gif"></td>

You see, PHP 5.1.6 properly renders the $mosConfig_live_site PHP variable to http://www.mywebsite/en/, while PHP 3.1.6 does not.

Furthermore, when I opened the Mambo Admin page, all the icons disappear, as shown on the screenshot below.
[IMG]http://i3.photobucket.com/albums/y71/kreshna_iceheart/IT%20Problems/Mambo%20vs%20PHP%2053/MamboAdmin--PHPbaru.jpg[/IMG]

FYI, the website runs fine on Mambo 5.16. For instance, the Mambo Admin page runs normal on PHP 5.1.6
[IMG]http://i3.photobucket.com/albums/y71/kreshna_iceheart/IT%20Problems/Mambo%20vs%20PHP%2053/MamboAdmin--PHPlama.jpg[/IMG]

I just don't have time to migrate the website to newer version of Mambo, or to Joomla. Is there any changes in Mambo that I should do?

Many thanks,
Find all posts by this user
Quote this message in a reply
05-02-2011, 12:09 PM
Post: #2
RE: How to run Mambo 4.5.3 on PHP 5.3.1 ?
Neither PHP 5.1.6 nor PHP 5.3.1 are currently in use at DreamHost, so I'm not sure how this relates. My first guess would be that you have enable_short_tags turned off for PHP 5.3, though.
Find all posts by this user
Quote this message in a reply
05-02-2011, 12:22 PM (This post was last modified: 05-02-2011 12:36 PM by Kreshna.)
Post: #3
RE: How to run Mambo 4.5.3 on PHP 5.3.1 ?
I see. I'll try it, thank you!
Well, it fixes the problem, but not entirely.

Now the Mambo Admin menu is fine. However, page contents still disappears. I suspect this is database problem, am I correct? Does Mambo access the database in a way that PHP 5.3 doesn't like?

Also, this message still apperas:
Warning: Parameter 2 to frontpage() expected to be a reference, value given in D:\xampp\htdocs\en\includes\Cache\Lite\Function.php on line 100
Find all posts by this user
Quote this message in a reply
05-03-2011, 11:46 PM (This post was last modified: 05-03-2011 11:46 PM by Kreshna.)
Post: #4
RE: How to run Mambo 4.5.3 on PHP 5.3.1 ?
EUREKA!

I found the answer somewhere, buried in the Mambo Foundation forum, and here is the step:

I modified the file includes/Cache/Lite/Function.php in my mambo folder, changing the following lines:
Code:
function call()
    {
        $arguments = func_get_args();
        $numargs = func_num_args();
        $id = serialize($arguments); // Generate a cache id

Into:
Code:
function call()
    {
        $arguments = func_get_args();
        $numargs = func_num_args();
        for($i=1; $i < $numargs; $i++){
            $arguments[$i] = &$arguments[$i];
        }  
        $id = serialize($arguments); // Generate a cache id
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: