Last modified: 2014-02-19 11:25:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20010, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18010 - Remove .php5 files from MediaWiki root
Remove .php5 files from MediaWiki root
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-16 23:54 UTC by Brion Vibber
Modified: 2014-02-19 11:25 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2009-03-16 23:54:06 UTC
Some mixed PHP4/5 systems default to running PHP 4 through '.php' files and PHP 5 only on '.php5' files.

It might be nice to have the .php files for entry points be clean enough to load up from PHP 4 and redirect to the .php5 entry point.

Obvious main problem is what to do if there is no .php5 handler set up either. :) Could stick an explanatory notice in the source, I suppose... or only do it if the $wgScriptExtension is set to '.php5' (in which case the installer's already vetted it for us)
Comment 1 Daniel Friesen 2011-12-30 23:03:30 UTC
Trying to include LocalSettings.php to see what the value of $wgScriptExtension is is liable to load up some php5-isms in extension code that break the php4 loading.

We may be better off not trying to redirect like this. At most maybe we can include a link in the error.

"MediaWiki requires PHP 5, you appear to be running PHP 4. Note that some hosts use a .php5 extension instead of .php for their PHP 5 setup. You can try visiting [this url] to see if it works."

At most I think the only place we should ever have a redirect would be in index.php for the installer redirect or something like that.
Comment 2 MZMcBride 2012-09-08 20:41:47 UTC
How long do the .php5 files need to stick around?

Presumably we could just update the docs at some point to say "if you're in a mixed hosting environment, try this..." instead of shipping both files as we do currently?
Comment 3 Brion Vibber 2012-09-09 17:45:19 UTC
I'd say it's safe to dump them at this point. PHP5 is 8 years old; if you're in a mixed hosting environment you need a new host.
Comment 4 MZMcBride 2012-09-09 20:41:51 UTC
Changing the bug summary from "Active .php entry points should redirect safely to .php5 variants on PHP 4" to "Remove .php5 files from MediaWiki root", marking this bug as easy (it should just be a matter of a few simple deletions, I think?), and targeting this for 1.21 as I think it's a bit too abrupt to include in 1.20.
Comment 5 Chad H. 2012-11-26 16:29:36 UTC
Done in https://gerrit.wikimedia.org/r/#/c/35171/

Wondering if we should drop redirect.phtml and wiki.phtml as well--most hosts are unlikely to have these extensions registered for PHP anyway.
Comment 6 Brion Vibber 2012-11-26 19:22:46 UTC
Yes, kill them please.
Comment 7 MZMcBride 2012-11-26 23:23:27 UTC
(In reply to comment #5)
> Wondering if we should drop redirect.phtml and wiki.phtml as well--most hosts
> are unlikely to have these extensions registered for PHP anyway.

As long as en.wikipedia.org/w/wiki.phtml-type URLs continue to work, I agree with Brion that these can be killed. That is, for MediaWiki core, they're fine to drop, but for Wikimedia wikis (such as the English Wikipedia), there are still hundreds (maybe thousands) of old URLs that must continue to work (cf. <https://en.wikipedia.org/w/index.php?title=Special:LinkSearch&limit=500&offset=0&target=http%3A%2F%2Fen.wikipedia.org%2Fw%2Fwiki.phtml>).
Comment 8 taste1at 2012-12-14 16:40:18 UTC
Platonides wrote in gerrit:

> We can probably remove all but index.php5

I don't have a gerrit account, so I'm answering here:

I think this is not a good idea because it may cause hidden errors, like the wiki is accessible but without stylesheets and javascript (because of missing load.php5 etc.).

So maybe just tell the admins in the release notes that they can just leave the old *.php5, *.phtml files in place if they need it for compatibility.

This would be possible, becuase $wgScriptExtension is not dropped by Chad's patch.
Comment 9 MZMcBride 2013-04-09 02:35:04 UTC
At <https://gerrit.wikimedia.org/r/35171>, Tim wrote:

---
It seems like the wrong thing to do as a first step. It seems more sensible to remove $wgScriptExtension, convert the .php5 files to redirects instead of inclusion, and announce deprecation. But actually breaking the URLs seems like something we should do as a last step, if we do it at all.
---

Chad then abandoned the proposed changeset.

I agree that a slower deprecation process would be nice here. Redirect for a while and announce in the release notes for a version or two. I'm not convinced that the .php5 files need to stay around forever (or even within master), though. The tarball generation script could add the redirects, maybe.
Comment 10 Andre Klapper 2014-02-19 11:25:50 UTC
Removing "easy" keyword - some of comments in Gerrit:

‹wgScriptExtension is still used in core to determine path to php files in PHP and JS. Needs to be updated to be php if set to php5.
Otherwise mw will keep generating files to load/api.php5›

‹It seems like the wrong thing to do as a first step. It seems more sensible to remove $wgScriptExtension, convert the .php5 files to redirects instead of inclusion, and announce deprecation. But actually breaking the URLs seems like something we should do as a last step, if we do it at all.›

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links