Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11728 closed enhancement (fixed)

Install.php Needs PHP Errors

Reported by: miqrogroove's profile 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 15 years ago.
I don't want to be associated with this patch…

Download all attachments as: .zip

Change History (10)

#1 @nacin
15 years ago

Something like this?

@nacin
15 years ago

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

#2 @miqrogroove
15 years ago

  • Keywords has-patch added

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

LOL!

#3 @filosofo
15 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.

#4 @nacin
15 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.

#5 @miqrogroove
15 years ago

  • Keywords tested added

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

#6 follow-up: @nacin
15 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.

#7 in reply to: ↑ 6 @nacin
15 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.

#8 @dd32
15 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 ......"

#9 @nacin
15 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.