Jump to content

Can scripts written for PHP4 not work with PHP 5?


TecTao

Recommended Posts

An old client who I helped with a membership site called and said his site is not working.  He hosts with IPower web. 

They are moving his site to a new server and platform.  Non of the membership features of his site works.

 

His email indicated that they had contacted him the the reason it doesn't work is an upgrade from mySql 4 to 5, but i ran a phpinfo.php page and he has mysql 4.1 but runs php 5.1

 

I haven't determined if the problem with the site is that they are shutting down his old server and he needs to have it moved the the new platform or that they upgraded PHP4 to 5 and now there are script errors due to syntax errors.

 

I find that hard to believe but maybe it's possible.

 

Thanks for any comments in advance.

Link to comment
Share on other sites

This is the second thread you have created for this. You marked the first one [solved] before anyone had even replied to it.

 

There are very few incompatible difference going from php4 and php5. Even valid php4 OOP syntax works under php5 - http://www.php.net/manual/en/migration5.incompatible.php

 

The type of problems you normally have when moving between servers are do to php.ini configuration differences. Over time, php has depreciated some early and insecure features and these are turned off in the current recommended php.ini settings.

 

The mysql client version that phpinfo() reports is not the mysql version. It is the version of the client library that php was built with. You may infact be having a mysql4 to mysql5 problem, but without any specific information or errors... it is not possible to tell for sure. A common problem when upgrading mysql is this error -  http://dev.mysql.com/doc/refman/5.0/en/old-client.html

 

The hosting company should actually be able to tell you (or post) the php.ini configuration differences they are using between the php4 and php5. This would help identify what things in existing code need to be looked at.

 

Typically, membership systems use forms ($_POST variables) and sessions. Both of these are affected by register_globals, so it is highly likely that your code is dependent on register_globals being on. If so, don't turn them on (even if the host permits it) because register_globals have been completely eliminated in upcoming php6.

 

Posting the code would be the quickest way for someone to be able to tell you what it might be doing that is php.ini configuration specific.

 

 

Link to comment
Share on other sites

Guest
This topic is now 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.