Jump to content

[SOLVED] Help required with PHP errors on my site after PHP, Mysql upgrade please!


and1c

Recommended Posts

HI guys.

I just lost a huge post becuase the session timed out when I got to posting it  :'( so heres a summary!!

 

I truly hope one of you PHP experts can maybe help please..

 

ok.My server raid array went down > the data centre replaced it (under maintenance) but reinstalled a vanilla minimum install of Centos 4.4. It was 4.2 before and my 3 main websites worked perfectly.

 

Now I have restored the sites and setup the server again (using Yum for speed and easiness later on to update) and have the following on it

 

Old server setup Was

 

PHP Version 4.4.1

Apache 2.xx?

Linux 2.6.9-11.ELsmp

Apache API version 20020903

Mysql 5.0.18

Zend Engine v1.3.0,

 

 

New server setup:

 

PHP Version 5.1.6

Apache 2.0.59

Linux 2.6.9-42.0.10.ELsmp

Mysql 5.0.27

Zend Engine V2 (turned on compatibility for Zend 1)

 

ok. One site works ok but its just html mainly.

My forum site works ok up to now (quite a large VB forum)

 

My main online advert site is not working properly at all.

it is a PHP/Mysql site initially designed by a coding company and I (and a few programmers Ive employed) have customised it a lot. It worked perfectly b4 this nightmare and now I cannot login to the control centre, and customers cannot login of access any dynamic content pages (like adverts)

 

The errors are all like this:

 

[Tue Mar 06 23:12:31 2007] [error] [client xxxx ] PHP Warning:  Variable passed to each() is not an array or object in /var/www/html/mysite.com/forms/main_login_form.php on line 9, referer: http://www.mysite.com/my-cv.html

 

The code surrounding this is...

 

<?php

if($tolog=='jobhunter') {

   ?>

   <form action="<?php echo bx_make_url(HTTP_SERVER.FILENAME_LOGIN_PROCESS."?login=jobhunter", "auth_sess", $bx_session);?>" method="post" style="margin: 0px;"><?php if(!$HTTP_POST_VARS['redirect']) {?>

   <input type="hidden" name="redirect" value="<?php echo preg_replace("/&(?!amp;)/","&",$HTTP_SERVER_VARS["REQUEST_URI"]);?>">

    <?php

    }//end if (!redirect)

                 

 

The last line is line 9!!! Note, this is not my code and I am not yet a fluent php coder though I have a fair idea at this stage.All help gratefull appreciated please.

 

thanks

 

 

 

 

Has nobody got any ideas ???

 

Im not asking for a handout  ;)

Just if anyone has any pointers as I am totally stumped.

 

Is there any major changes that could have caused this in the latest version of PHP??

 

I was on v4 before so Im sure that the culprit. Its jsut what variable or config option do I need to correct?

 

Heres to hoping someone can help!

$HTTP_SERVER_VARS and the like have long been depricated in favour of there shorter $_SERVER, $_POST and $_GET type arrays.

 

There is probably nothing really wrong with your code, you just need to adjust the php.ini file a little, but, realistically, moving an application from php4 - php5 is a pretty big jump and not all functionality will be compatible.

 

Make sure you enable long array variables. Sorry, Im not 100% sure what its called as Im not at my servers.

 

$HTTP_SERVER_VARS and the like have long been depricated in favour of there shorter $_SERVER, $_POST and $_GET type arrays.

 

There is probably nothing really wrong with your code, you just need to adjust the php.ini file a little, but, realistically, moving an application from php4 - php5 is a pretty big jump and not all functionality will be compatible.

 

Make sure you enable long array variables. Sorry, Im not 100% sure what its called as Im not at my servers.

 

 

Ahh, thanks for the suggestion.

And yes... jumping from 4 to 5 I know is a big jump and one I would not have taken if there was any other option!! Ideally I would have setup a test server, migrated the site, tested and updated it over time until it was configured and working fine, then done a migration then  :) Sadly though, I had no other option :(

 

I will have a look at tweaking php.ini right now!!

 

Edit:;

 

You are offficially my Hero Thorpe  ;D

 

I totally forgot about those superglobals  :-\

 

and php.ini had them set to 0 or No!

 

Allowed them and bingo....all sorted.Many Thanks

 

Also, is it worth recoding the site with superglobals?? (or having someoen do it)

 

Will I see noticeable performance benefits?

 

 

 

 

 

 

 

 

Does anyone know what varai

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.