Ticket #1496 (closed defect (bug): wontfix)
wp-settings.php should dl() mysql.so if it's not loaded as an extension
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | General | Version: | 2.0.2 |
| Severity: | minor | Keywords: | bg|squashed bg|commit |
| 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
Change History
comment:1
auroraeosrose — 7 years ago
comment:2
masquerade — 6 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
comment:5
davidhouse — 6 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.
SteamedPenguin — 6 years ago
-
attachment
wp-settings-mysql-check-patch.diff
added
Fixed missing comma in last patch
comment:6
SteamedPenguin — 6 years ago
Please test latest patch: wp-settings-mysql-check-patch.diff
comment:7
SteamedPenguin — 6 years ago
wp-settings-mysql-check-patch.diff also works for WP 1.5 codebase. Please consider for backport to 1.5 branch
comment:8
davidhouse — 6 years ago
- Priority changed from normal to low
- Version changed from 1.6 to 2.0.2
- Severity changed from normal to minor
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.
comment:9
SteamedPenguin — 6 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.
comment:10
ryan — 6 years ago
Resurrecting this one...
Do we give Debian users the convenience of dl() even though it is being deprecated and is a performance killer?
comment:11
ryan — 5 years ago
- Status changed from new to closed
- Resolution set to wontfix
Ubuntu installs everything correctly these days. Won't fix.

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