Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#29489 closed defect (bug) (wontfix)

wp_check_php_mysql_versions() is broken in PHP 4

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

Previously: #21316

We no longer get a proper error message when trying to install on PHP4. Here's a rundown of parse errors:

http://trunk.wordpress/ or http://trunk.wordpress/wp-admin/install.php

  • syntax error, unexpected T_OBJECT_OPERATOR in wp-includes/functions.php on line 3668 (ref)
  • syntax error, unexpected T_VARIABLE in wp-includes/option.php on line 241 (ref)
  • syntax error, unexpected T_VARIABLE in wp-includes/option.php on line 367 (ref)

http://trunk.wordpress/wp-admin/index.php

  • syntax error, unexpected T_OBJECT_OPERATOR in wp-admin/index.php on line 103 (ref)

http://trunk.wordpress/wp-admin/setup-config.php works as expected:

  • Your server is running PHP version 4.4.7 but WordPress 4.0-RC1-src requires at least 5.2.4.

The first three points are a regression, it worked fine in 3.9.

Change History (8)

#1 @markoheijnen
10 years ago

What is the plan for this? Moving to 4.0.1?

#2 @SergeyBiryukov
10 years ago

Not sure if we still care about PHP4 (or if there are still any hosts with PHP4 by default), decided to document the regression just in case.

It might no longer be trivial to make the bootstrap files parsable by PHP4, but it would be nice to display a proper error message if possible.

This ticket was mentioned in Slack in #core by sergeybiryukov. View the logs.


10 years ago

#4 @nacin
10 years ago

I'm wondering how much I care about this.

if wp-admin/install.php otherwise parses, could we do a stupid simple check before any requires occur, and bail? I mean something ridiculous like:

if ( version_compare( phpversion(), 5, '<' ) ) {
    header( 'Content-type: text/html; charset=utf8' );
    die( 'Your server is running PHP version 4, which is not compatible with WordPress. <a href="https://wordpress.org/about/requirements/">https://wordpress.org/about/requirements/</a>' );
}

I don't care about any other path, except the readme entry point, which is wp-admin/install.php.

If wp-admin/install.php isn't otherwise parseable, then I really just don't care. If it is, then maybe we can set up some kind of CI on this to ensure it always remains passable.

#5 @dd32
9 years ago

The number of servers running PHP 4/5.1/5.0 is small enough that I don't think we should even consider to retain PHP4 parsability.
For reference, the last PHP4 security release was August 2008.

This ticket was mentioned in Slack in #core by ocean90. View the logs.


9 years ago

#7 @dd32
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Two years later, and I still don't care.

Having wp-admin/install.php parse as PHP4 is useless as the WordPress bootstrap also has to parse in order to redirect a user there. We've added more incompatibilities over time into that process and IMHO ensuring that the bootstrap also parses seems like a waste of everyones time and effort in this day and age.

I'm removing the Must be parsable by PHP4 comments and moving on.

#8 @dd32
8 years ago

In 38899:

Drop the requirement for the entry points to WordPress to be parsable by PHP4.

Previously we ensured that the entry points to WordPress were parsable by PHP4 in order to display a friendly not-supported-php error message.
However, for the last two years the main entry points have not actually parsed, and we've only added extra parse errors since it last worked in 3.9, so it's time we just remove this 'feature'.
The PHP version checks are still there for PHP 5.0/5.1, and so it's inplace when we eventually drop PHP 5.2 support.

See #29489.

Note: See TracTickets for help on using tickets.