Hostmonster PHP upgrade from 5.2 to 5.4

I have been contacted by Hostmonster and informed that they will be phasing out PHP 5.2 and replacing it with PHP 5.4. I have tested my site and it is incompatible with 5.4 (I just get a white screen).

I contacted my developer and he has quoted me $1000 to upgrade my site to PHP 5.4. Is this a reasonable amount or is the fix relatively straightforward?

Looking at the error logs I see: “Call-time pass-by-reference has been removed in /”

I have looked at this and see that my files contain &$, when they should contain $ only.

Can I do a find and replace to fix this? If so, how would I do that?

Any help or advice you could give me would be appreciated because I don’t want to pay a huge amount of money to fix something that can be rectified easily.

Thanks in advance.

I guess one would need to know roughly the size of your project. For instance, what your php project is for? How many php files? How many lines? 5.2 to 5.4 I suspect is a sizeable jump in versions. Depending on your site and what it does it may be cheaper to use a completely different software technology but more information would be needed to know.

PHP 5.2 is way too old and out-fashioned, its your fault to have designed your code to be incompatible with more up-to-date version of PHP in the very first place. You cannot blame hostmonster for this, they are just doing what is right and no one can stop this trend. I am liking the fact that most webhosts are moving out of PHP 5.2 since my own project requires PHP 5.3+, it will get me less questions/emails on blank pages due to PHP incompatibility. Your best shot is to see if refactoring will work, otherwise a complete rewrite is necessary.

Settle down there. This isn’t the person who wrote the code. :slight_smile:

Fixing just that one issue would be rather simple but there are a number of other things that could be broken in addition to that. You only see that one error logged because PHP doesn’t go any further once it hits that. So, yes, it does depend on the size of the project as well as how it was written. This particular functionality was deprecated since 5.0 so it really shouldn’t have been written that way unless it was written for PHP 4 originally.

Thanks everyone.

The site is large and complicated so I will go ahead with my developer’s recommendation.

If a backend database is being used and it is MySQL, make sure he’s also using at least the mysqli* extension and calls (or redesigns the database coding to use PDO), since the mysql* extension and calls are deprecated and will eventually disappear.