Php and MySQL

Hi Experts,

I'm trying to install PunBB. But, when i'm trying to save the DB settings in i got this error: "This PHP environment doesn't have MySQL support built in. MySQL support is required if you want to use a MySQL database to run this forum. Consult the PHP documentation for further assistance."

The specs:
Platform: WindowsXP
Server: Apache (last version)
PHP: php4.1
forum: PunBB (last version)

do i need to add something in php.ini? or in httpd.conf?

thanks you for any suggestions..

Who is Participating?
# From

Error: "Fatal error: Call to unsupported or undefined function mysql_connect() in .." This means that your PHP version isn't compiled with MySQL support. You can either compile a dynamic MySQL module and load it into PHP or recompile PHP with built-in MySQL support. This is described in detail in the PHP manual.

Ok. So...

LXXIX. MySQL Functions

These functions allow you to access MySQL database servers. More information about MySQL can be found at

Documentation for MySQL can be found at

In order to have these functions available, you must compile PHP with MySQL support.

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.

    Note: Windows users will need to enable php_mysql.dll inside of php.ini and either copy libmysql.dll into the Windows system directory, or make it available to the PATH.

    This will fix "Unable to load dynamic library './php_mysql.dll'" errors.

For compiling, simply use --with-mysql=[DIR] where [DIR] points to your MySQL installation directory.

This MySQL extension doesn't support full functionality of MySQL versions greater than 4.1.0. For that, use MySQLi.

If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts.


Crashes and startup problems of PHP may be encountered when loading this extension in conjunction with the recode extension. See the recode extension for more information.

... end quote.

I believe the WIndows version comes with the dll, you just uncomment the appropriate line in php.ini under Windows. On linux, a configure, make clean, make, make install is required.

You need to install MySQL and configure Apache and PHP to use it.

Download of MySQL can be found here....

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

m_renaudAuthor Commented:
i'm sorry i forgot to tell you that MySQL4.1 is installed!! :|
like Promethyl already said...

check that mysql.dll is uncommented in your php.ini

just open your php.ini in an editor search for mysql.dll
and uncomment it.

#extension = mysql.dll;

extension = mysql.dll;

after you did this, mysql support should be enabled.
you can check it in phpinfo
m_renaudAuthor Commented:
Hi AndyWHV,

there is no "#extension = mysql.dll;" is the php.ini file...
but only ";extension=php_mysql.dll"

m_renaudAuthor Commented:
and i'm sorry... i'm using php5 not php4 (i'm so dumb!)..

thks again!
Remove the ; before the "extension=php_mysql.dll", save the file. Restart apache or IIS (whichever webserver you may happen to have) and give it a shot!
m_renaudAuthor Commented:
Yes it's what i have done...
but i had to add  extension_dir = "C:\PHP\ext" in the php.ini file.
now it's work!!!

thank you to each of you...
i'll split the points!!

Thks again


Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.