MySQL Forums
Forum List  »  PHP

Re: php mysql connection help..
Posted by: Jonathan Stephens
Date: June 06, 2005 08:24AM

Same answer -- if you want to use MySQL with PHP 5, you must enable one of the two MySQL extensions -- ext/mysql or ext/mysqli.

To enable the mysql extension:

1. Copy libmysql.dll to a directory in your system path.
2. Make sure there's a line reading: extension = php_mysql.dll in you php.ini file, and that there's no ; at the beginning of the line.

To enable the mysqli extension:

1. Copy libmysql.dll to a directory in your system path.
2. Make sure there's a line reading: extension = php_mysqli.dll in you php.ini file, and that there's no ; at the beginning of the line.

On my test machine running Windows 2000 Server with Apache 1.3.37, PHP 5.04 (as mod_php5), and MySQL 5.0.4-max:

* PHP installed in C:\php - php_mysql.dll in C:\php\ext

* C:\php added to system path - libmysql.dll in C:\php - this is the version of libmysql.dll that comes with PHP 5.0.4, not the version that comes with MySQL.

* php.ini file in C:\WINNT with the uncommented lines:
extension = php_mysql.dll
and
extension = php_mysqli.dll

(I have both extensions - mysql and mysqli - enabled on that system.)

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.