Is PHP 5 production ready?

liunx

Guest
Ok well I think the title says it all, my client I currently have has a dedicated server in which he wants to use PHP 5 specifically the latest one 5.1.1 and also the latest MySQL. I personally have nothing wrong with that except I have no experience using the MySQL 5 and not entirely sure its ready but thats not what I am asking about. Do you think PHP 5 is production ready to be put on a server and used?

I personally do not think I will require any of the functionality of PHP 5 but the project is not 100% layed out so there could be a chance. The client would like to use the latest which is why he has chosen the latest of both for two reasons 1) if there were aspects where the new functionality could be used, it would be used and 2) not having to worry 6-12months down the track if he chose v4 about upgrading to php 5 and finding that there were small bits which didnt work.My thoughts are...

Production ready, yes. Should you use it, yes.
Why, exactly as you said - don't wanna regret it and give yourself more work in the future.

Check out the PHP5 only functions, see if yah could improve your code by using them. Weigh the pros and cons.

If you plan on using any open-source software PHP5 + MySQL5 will give you a headache, unless it is supported ;). I installed PHP5/MySQL5 on my pc and had my server changed only to then work on a project with... *looks around for Elizabeth*... OsCommerce and PHP4. Plus some of my queries broke with MySQL5, not sure why, not great with My/SQL either way.

Summary: Do more planning (with future expansion in mind), Check out php5 features.Well, you could create two identical applications. One for version 4, one for version 5. Then, just do a quick phpversion() check. If it's php4, include all files from directoryA, otherwise directoryB.

I'm currently caught in a hard-place because i'm trying to figure out a way to make a PHP6 feature available now to my script. In php6 they're saying that var and public are synonymous in classes (FINALLY!). Well, since php6 isn't out yet, PHP5 throws a strict-standards error if you use the deprecated var identifier. PHP4 doesn't recognize the public/private/protected identifiers. See the dilemma?

For me personally i think that 2 versions of the same scripts will be available. I can say that because I know that the difference(s) between PHP5 and PHP4 in my case is just a few minor issues. Depending upon the size of your script, it may not be feasible.

PHP 5 is production ready. mySQL I don't think is as ready as it could be. I know it's stable and rock-solid; however, it's under a new license. I think PostgreSQL would be a better solution now, or at least a better alternative. Even SQLite wiould work.

But look at your code and see if you need PHP5. If you don't (i.e. your code won't use any PHP5 functions) stay with PHP4 and wait for PHP6. If you need functions that are only in PHP5, then upgrade. I honestly haven't seen a huge difference except in which functions and DOMs are available and more-accessible.

So it's a planning thing as Jason said. Do you need the XML DOM and other PHP5 features, or can you live with PHP4 and its security until PHP6?

Same goes for mySQL. Do you use any mySQL 5 functions or not? If no, stick with 4 as it seems to be more widely adopted. If you just MUST use mySQL 5, check out the PostgreSQL database solution as an alternative. Heck, it might even be faster... but I'll let Sxooter fight that battle...

~Brett
 
Back
Top