Red Hat Bugzilla – Bug 141903
PHP compiled without MySQL support!
Last modified: 2007-11-30 17:10:56 EST
Description of problem:
PHP has been compiled using the --without-mysql flag as can be seen
Version-Release number of selected component (if applicable):
A worthless rpm for those wanting to use PHP with MySQL, which is
probably 98 percent of those wanting to use PHP.
PHP compiled with MySQL support.
I know we have went over this before and it's not rocket science.
Ohh and while I have you attention the --without-gd flag is also
So, if we could get that with the --with-mysql and --with-gd flags
instead, I'm sure a lot of people including myself would be much
happier, since many CMSs use MySQL and the GD library. ;)
Do you have php-mysql installed?
Yes, of course, however that is not going to help when PHP has been
compiled using the --without-mysql confgiuration option.
"By using the --with-mysql[=DIR] configuration option you enable PHP
to access MySQL databases.
In PHP 4, the option --with-mysql is enabled by default. To disable
this default behavior, you may use the --without-mysql configure
option. Also in PHP 4, if you enable MySQL without specifying the path
to the MySQL install DIR, PHP will use the bundled MySQL client
libraries. In Windows, there is no DLL, it's simply built into PHP 4.
Users who run other applications that use MySQL (for example,
auth-mysql) should not use the bundled library, but rather specify the
path to MySQL's install directory, like so:
--with-mysql=/path/to/mysql. This will force PHP to use the client
libraries installed by MySQL, thus avoiding any conflicts.
In PHP 5, MySQL is no longer enabled by default, nor is the MySQL
library bundled with PHP. Read this FAQ for details on why."
There are very few applications out there that can be compiled without
support for something and then have that same support included latter
without recompiling it. PHP is not one of them and this is not the
first time this problem has occured in Redhat. The fix last time is
the same as it is this time, to recompile PHP without using the
--without-mysql configuration option or in the case of PHP5, use the
--with-mysql configuration option.
I can't see any sane reason not to compile PHP with MySQL and gd
support, there are quite a few strange compile options used in this
build which I could address, though since they don't break anything or
cause a lack of useful function (at least from my standpoint) I won't
be addressing those, but giving you an example, the
--with-apxs2=/usr/sbin/apxs flag is also used, though it appears that
the Apache server included was not compiled with apxs.
If you have installed the php-mysql package, then what bug are you
reporting? If php-mysql is installed and mysql support does not work,
please post the output of:
# rpm -V php php-mysql
# php -m | grep mysql
Please do read *all* of the spec file. The MySQL extension is built
once, when building the CGI SAPI. It is built as a shared extension,
mysql.so, and packaged in the php-mysql package.
When building the apache2handler SAPI, --without-mysql is passed to
prevent building the extension again.
PHP can not use MySQL, that is the bug I am trying to report.
-sh-2.05b# rpm -V php php-mysql
-sh-2.05b# php -m | grep mysql
-sh-2.05b# rpm -qa|grep mysql
-sh-2.05b# rpm -qa|grep php
-sh-2.05b# php -m | grep mysql
is demonstration that php is loading the MySQL extension without
problems. Please attach a secript which demonstrates a bug. The fact
that the phpinfo() output mentions "--without-mysql" in the configure
line is not a bug.