Php and MySQL

Hi Experts,

I'm trying to install PunBB. But, when i'm trying to save the DB settings in 127.0.0.1/forum/install.php... 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..

Mart.
LVL 3
m_renaudAsked:
Who is Participating?
 
PromethylCommented:
# From Mysql.org:

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
Introduction

These functions allow you to access MySQL database servers. More information about MySQL can be found at http://www.mysql.com/.

Documentation for MySQL can be found at http://dev.mysql.com/doc/.
Requirements

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

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.

Warning

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.

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


Alan
0
 
AlanJDMCommented:
Download of MySQL can be found here....

http://dev.mysql.com/downloads/index.html


Alan
0
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!! :|
0
 
AndyWHVCommented:
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.

before:
#extension = mysql.dll;

after:
extension = mysql.dll;

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

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

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

thks again!
0
 
PromethylCommented:
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!
0
 
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

Mart.

0
 
PromethylCommented:
Thank you.
0
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.