WordPress.org

Ready to get started?Download WordPress

Forums

Do yourself a favor: Use PHP5. (18 posts)

  1. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    While it's true that WordPress' requirements are PHP 4.3 or higher, you will get maximum effectiveness if your hosting service supports PHP 5. I highly recommend that you enable PHP 5 support on your hosting service *before* installing WordPress. If you're already running WordPress, then you can quite likely switch to PHP 5 without any modifications, or very minimal adjustments in some cases.

    Officially, PHP 4 itself is unsupported, and has been for about a year now. Unfortunately, the hosting community has been very slow to respond and upgrade. Many hosts nowadays do offer PHP 5 support, but it tends to have to be something you enable manually, or something you have to ask for.

    WordPress runs demonstrably faster under PHP 5. The main reason for this is that WordPress includes a compatibility layer. Whenever it needs a PHP 5 only function that it can't find, it tries to include a backwards compatible form of that function. This backwards compatible form is inevitably slower.

    Also, WordPress has begun to add support for PHP 5-only functionality as well. That is, some newer features only work with the PHP 5 code, they're simply disabled for PHP 4 code. In these cases, writing a compatibility layer was considered unnecessary or too slow. The best example of this is the Daylight Savings Time and named Timezone support.

    So in the not-too-distant future, it's likely that WordPress could switch to requiring PHP 5 support entirely. Many things that are somewhat problematic with WordPress seem to sometimes magically work fine when switching to PHP 5 (notably, I've seen a lot of hosts that can do the auto-upgrade properly on PHP 5 and not on PHP 4). Many plugins are starting to require PHP 5 support right now, so it's in your best interest to switch.

    The GoPHP5 initiative was started to get wider support for PHP 5, by signing on projects to drop PHP 4 support. WordPress did *not* join in on that initiative at the time, and still supports PHP 4.3 and up, but this was primarily based on statistics that show that a large percentage of WordPress users still use PHP 4.3 hosting services.

    The best way you can help adoption is to make sure that you and your sites use PHP 5. With enough people using it, we can start migrating forward and using some of the newer functionality which many developers are so desperate to be able to use. :)

    A codex article on how to switch is here: Switching to PHP5

  2. sachok
    Member
    Posted 4 years ago #

    YES, COOL!!!

  3. Roy
    Member
    Posted 4 years ago #

    My host supposedly supports both. 'Normal PHP' files are handled with 4, .PHP5 files with 5. When I want all files to be handled with 5 I have to add this to the htaccess "AddHandler x-httpd-php5 .php".

    Does that mean I don't have to do anything or will WP have .PHP files that are still meant to be executed by 5?

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    WordPress will only use the PHP extension, so you'll want to make your host run those under PHP 5. You'll get better compatibility and perhaps even speed improvements by doing so.

  5. Roy
    Member
    Posted 4 years ago #

    As a not-too-techy this beats me, but when I don't add the line I apparently run 4.4.7 and when I do, it's 5.2.4 (thanks to the security scan plugin which tells me). Probably doesn't hurt. I'll just see if those speed improvements prove right too.

    [edit] Hmmmmmm, why do such things always work on my test install, but not on the rest................? Adding the line to a 'live install' results in pages not found all over the place.

  6. starlupi
    Member
    Posted 4 years ago #

    Hello,

    Why the codex say
    http://codex.wordpress.org/Hosting_WordPress

    Server requirements

    WordPress server requirements for Version 2.9:

    * PHP version 4.3 or greater
    * MySQL version 4.1.2 or greater
    * (Optional) Apache mod_rewrite module (for clean URIs known as Permalinks)

    WordPress server requirements for Version 2.5, 2.6, 2.7, 2.8:

    * PHP version 4.3 or greater
    * MySQL version 4.0 or greater
    * (Optional) Apache mod_rewrite module (for clean URIs known as Permalinks

  7. norrismp
    Member
    Posted 4 years ago #

    Upgraded to PHP5 5 minutes ago and it worked like a charm! All plugins work fine. Theme works great.

    Best part is: HUGE speed increase noticeable right off the bat. We're talking 2-3 times faster. Site was taking 5 seconds to load and we are now down to just under a second. Very glad I did this (and waited so that everything was already compatible :)

  8. CharlesClarkson
    Member
    Posted 4 years ago #

    Why the codex say
    http://codex.wordpress.org/Hosting_WordPress

    The Codex states that because those are the minimum web server requirements for WordPress.

    Otto is pointing out that there is an alternative to the minimum web server configuration.

  9. kservik
    Member
    Posted 4 years ago #

    Hopefully the WordPress Community will drop the support for PHP4 soon. It would be much better to just move on when only 11% of WP users still use PHP4.

  10. DaForum
    Member
    Posted 4 years ago #

    Why versions of wordpress are still released under php4 ?

    We are now at php 5.3, and in my opinion, it's not a good thing to maintain only one version in php 4.

    You could release a php5 version and let the php4 version available to download for those who can't run php5 programs.

  11. Dion Hulse
    WordPress Dev
    Posted 4 years ago #

    DaForum: Its not that simple really..

    Part of the issue is that at present, There has never really been any support for obsolete versions of WordPress, not even security updates.

    WordPress is used by millions of people, 10% represents a HUGE proportion of people, If of the 10million downloads, 10% were on PHP4, that represents 1 million downloads for PHP4 systems.. Of course, every download isnt an install.. so you can probably half those numbers.

    Leaving a huge group like that out in the cold with no security updates would be a disaster waiting to happen..

    ..This may change, WordPress 2.8 security patches are going to be backported from 2.9 until 3.0 is released, In other words, There'll be 2.8.x security updates worked on, until the day that 3.0 ships. Hopefully this will give people enough of a grace period to upgrade to the latest version of PHP available to them - approximately 4-6months by my calculations without being adversly affected too much...

    As a plugin developer, My plugins are not used by a million people, maybe a thousand, I have chosen to not support PHP4 with my plugins, unless its only a small work around, as soon as i have to do any major PHP4 compat work, it becomes a PHP5-only plugin - and more developers are going to do this as well, so it'll push people even more.

  12. hakre
    Member
    Posted 4 years ago #

    Choose a host where you have access to the files under the user your PHP files get exectued. Ensure you have built in ZIP Archive support. That will make your support personell lucky.

  13. Craig Hesser
    Member
    Posted 4 years ago #

    I fell (definitely did NOT stumble) over the php5 problem today (Christmas Eve). My Christmas present was that my hosting company said that to get php5, I had to change to upgraded servers! That means manually moving roughly 50 websites from one server to another with a different IP address, etc. (no, they don't do the move for you) but the new one has php5.x. I thought this whole thing over some months ago (a different problem) and decided against the move then - instead, I got a second hosting service that stays up with the developments. Sooner or later, the old server farm at my original hosting service will give up the ghost or get modified, so I'll wait for that and see what happens.

  14. StandardProduct
    Member
    Posted 4 years ago #

    Hi,
    Doest the hosting Company Hostgator.com has PHP5 normally or do I have to ask them for PHP 5 installation?
    Thanks

  15. obscure
    Member
    Posted 4 years ago #

    I am on 1and1.co.uk and just "enabled" PHP5 by using the process described at http://codex.wordpress.org/Switching_to_PHP5 and the site works faster and several new PHP5 only pluggins are now usable. :)

  16. aslamnaik
    Member
    Posted 4 years ago #

    StandardProduct: Hostgator has PHP5 installed.

  17. Matt Mullenweg
    Troublemaker
    Posted 4 years ago #

    I'm unsticking this because I don't entirely agree with it. I think GoPHP5 is misguided, and when we've relied on PHP5 features, like timezones, they constantly bite us in the butt.

  18. Craig Hesser
    Member
    Posted 4 years ago #

    @Standard Product: Hostgator has pHp 5.2.11 as of today. The various software versions are visible at the bottom of the left-hand sidebar of their cPanel's front page (title "Program versions"). Most other hosting operations have a similar display somewhere - if they don't have one, ask!

    One of my hosting companies said I could choose the php version in the application by using .php4 or .php5 in the software call to choose which version, but either it didn't function for me, or I missed something else that fouled up what I was trying to do.

Topic Closed

This topic has been closed to new replies.

About this Topic