[Help] php4 to php5 error

Discussion in 'PHP' started by Divvy, Mar 17, 2009.

  1. #1
    hi friends,

    I have my sites in a dedicated server with php4 and everything is work great.
    But now I purchased a new dedicated server with php5 and got an error in one of my sites.

    Can someone help me fixing him? Unfortunately, I don't understand anything about php to fix this errors my own.

    The error is:

    Line 2 of index.php file is:
    session_start();
    Code (markup):
    Some part of the code:
    <?
    	session_start();
    	
    	$s=$_REQUEST['s'];
    	$_SESSION['s']=$s;
    	if($s=='')
    	{
    		$s=0;
    	}
    	
    	$r=($s/30);
    	$np=($r+1);
    	if($np%3==0)
    	{
    		$nm1="skater1.jpg";
    	}
    	if($np%3==1)
    	{
    		$nm1="clip2.jpg";
    	}
    	if($np%3==2)
    	{
    		$nm1="img28.jpg";
    	}
    
    	$f=$_REQUEST['f'];
    	$cn=$_REQUEST['cn'];
    	$nm=$_REQUEST['nm'];
    ?>
    Code (markup):
    Can someone help me fixing this one?
    I don't understand why is working in php4 and don't work with php5.
    If you need the full code, please let me know.

    I really appreciate your help guys. Thank you! :)
     
    Divvy, Mar 17, 2009 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Hi.
    Looked into this, and found a thread here: http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/ that might help explain the error.

    Short version: you need to check your php.ini to see if the memcache is present and correctly set up, and maybe also check to see if the phpinfo() gives you the correct version and such.

    If you have full server access, might be a good idea to check to see if the memcache is correctly installed too.

    Read the thread I linked to, and see if it helps a little.
     
    PoPSiCLe, Mar 17, 2009 IP
  3. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #3
    The error suggests that you had non-default PHP extensions and config options on the old server. You'll probably have to make sure memcached is installed, and then make sure the php-memcached extension is installed.

    It's probably going to be worth having someone compare your old and new configs to bring the new server up to par. Chances are you're going to run into more errors like that with other extensions.
     
    joebert, Mar 17, 2009 IP