Forums

[sticky] Do yourself a favor: Use PHP5. (9 posts)

  1. Otto42
    Moderator
    Posted 1 month 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 1 month ago #

    YES, COOL!!!

  3. Gangleri
    Member
    Posted 1 month 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. Otto42
    Moderator
    Posted 1 month 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. Gangleri
    Member
    Posted 1 month 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 1 month 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 3 weeks 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 1 week 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 1 week 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.

Reply

You must log in to post.

About this Topic