WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#11728 closed enhancement (fixed)

Install.php Needs PHP Errors

Reported by: miqrogroove Owned by:
Milestone: 3.0 Priority: high
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch tested commit
Focuses: Cc:

Description

Something I saw come up several times in the forums after the 2.9 release was inexperienced webmasters reporting the "Error: %s" message.

This could be easily avoided by injecting <h1>Error: PHP Is Not Running</h1> in a spot where browsers can parse it but PHP does not.

Attachments (1)

11728-hack.diff (438 bytes) - added by nacin 5 years ago.
I don't want to be associated with this patch…

Download all attachments as: .zip

Change History (10)

comment:1 @nacin5 years ago

Something like this?

@nacin5 years ago

I don't want to be associated with this patch...

comment:2 @miqrogroove5 years ago

  • Keywords has-patch added

I don't want to be associated with this patch...

LOL!

comment:3 @filosofo5 years ago

Are you sure the problem is PHP not running? Or could you be more specific about the circumstances?

When I've seen Apache serve a PHP file without PHP running, it has offered it as a download, not as HTML / text.

comment:4 @nacin5 years ago

That probably depends on the configuration.

I had tested this using XAMPP. I turned off PHP and the browser was indeed served the file. The first text I got was "Error: %s" (if you look at the code, it makes sense why).

The patch here is pretty pathetic, but on most setups and most browsers, it would indeed the job.

comment:5 @miqrogroove5 years ago

  • Keywords tested added

Works in tested browsers: Internet Explorer, Firefox, Chrome, Opera, and Safari.

comment:6 follow-up: @nacin5 years ago

  • Keywords commit added

I've been debating whether this is necessary. It has come up very few times in the forums, and would mean that someone without PHP running to head directly to wp-admin/install.php, as of course they would not be redirected. So maybe it'll fix the problem for a handful individuals who clearly have no indication of what they are doing, but that's about it.

Marking as commit, it should either go in or be marked as wontfix.

comment:7 in reply to: ↑ 6 @nacin5 years ago

Replying to nacin:

would mean that someone without PHP running to head directly to wp-admin/install.php, as of course they would not be redirected.

miqrogroove pointed out what the readme says as part of the famous five-minute install:

Open <span class="file"><a href="wp-admin/install.php">/wp-admin/install.php</a></span> in your browser.

comment:8 @dd325 years ago

miqrogroove pointed out what the readme says as part of the famous five-minute install:

For that simple reason, I think this is worthy to go in.. As much of a weird hack as it seems

However, Some better text could be better. "WordPress requires that your webserver be running PHP. If you can read this text, either your webserver does not have PHP enabled or ......"

comment:9 @nacin5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [13428]) Add a sanity check in install.php, accounting for whether PHP is running. fixes #11728

Note: See TracTickets for help on using tickets.