Opened 19 years ago
Closed 18 years ago
#1496 closed defect (bug) (wontfix)
wp-settings.php should dl() mysql.so if it's not loaded as an extension
Reported by: | davidhouse | Owned by: | masquerade |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.0.2 |
Component: | General | Keywords: | bg|squashed bg|commit |
Focuses: | Cc: |
Description
People on debian and ubuntu are having problems with WordPress not picking up PHP's mySQL extension, because the extension_loaded('mysql') test is failing. However, this problem can be solved by dynamically loading the mySQL shared object file at runtime, using dl().
Patch:
--- wp-settings.php 2005-07-06 11:04:36.000000000 +0100 +++ wp-settings-new.php 2005-07-08 10:54:46.961662984 +0100 @@ -17,7 +17,8 @@ die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); if ( !extension_loaded('mysql') ) - die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); + if ( !dl('mysql.so') ) + die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); function timer_start() { global $timestart;
See Also:
http://comox.textdrive.com/pipermail/wp-hackers/2005-April/000821.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=312721
Attachments (3)
Change History (14)
#2
@
19 years ago
- Keywords bg|squashed bg|commit added
- Owner changed from anonymous to masquerade
Both of the above methods are insufficient. I've made a patch that should work where its possible, and still die out where its not. Marking for commit
#5
@
18 years ago
I think the version comparison was wrong as well: the manual says dl() is deprecated in 5.0+, so we should check to see if we're >= 5.0 and die if so, masquerade's patch had this backwards.
Patch attached which fixes both issues.
#7
@
18 years ago
wp-settings-mysql-check-patch.diff also works for WP 1.5 codebase. Please consider for backport to 1.5 branch
#8
@
18 years ago
- Priority changed from normal to low
- Severity changed from normal to minor
- Version changed from 1.6 to 2.0.2
If we have another release on the 1.5 branch, we could incorporate this. Not nearly a big enough issue to warrant a release on its own though.
#9
@
18 years ago
On its own, no, but there are some additions to the 1.5 branch that are adding up to another 1.5 release. Maybe not a 1.5.3, but a 1.5.2.1 wouldn't hurt.
oh please don't do it that way, you'll royally screw windows users - the proper way is this (straight from the manual)
if (!extension_loaded('mysql')) {
you HAVE to error suppress the dl because there's no way to easily tell if a server is TS (thread safe) and dl will spit out a warning if it is - can I get someone to fix the diff? I'm too lazy