Skip to main content
August 12, 2006
Answered

Can not connect to MySql with PHP in Dreamweaver

  • August 12, 2006
  • 4 replies
  • 3315 views
I am working through the Training from the source Dreamweaver 8 with ASP, ColdFusion and PHP book and when I try to setup the database connection it fails with an erro that says "Your PHP server doesn't have the MySql module loaded or you can't use the mysql_(p)connect functions".

I did some research and found some help on the MySqlForge Wiki site but even after uninstalling and re-installing PHP several times it still does not work.

I am running Windows XP sp2 PHP 5.1.4 (installed both using the Windows installer and manually) and MySql 5.

Thanks for the help

Bongo_Bob
This topic has been closed for replies.
Correct answer
David -

Wow, thank you, thank you, thank you! That did it. I already tried a couple of those steps except for the php_mbstring.dll and I (and my colleague who was helping me) totally missed the quotes around the path to the ext folder, duh :(

Thanks again

Bongo_Bob

4 replies

Participant
August 30, 2006
i have no idea as to why the following change would have made this work, but all of the above that you mentioned were already done. the only other thing i ended up uncommenting in the windows extentions was mssql.dll, and after that it worked. i know i know...microsoft sql extensions should have nothing to do with mysql extensions, so go figure. at least it worked finally and i was able to test my code before moving it up to our production server. thanks for the help.
Inspiring
August 20, 2006
slw13 wrote:
> C:/php/php.ini
>
> that is where i have php installed and where the file is.

Good. That means that Windows is reading the correct configuration file.

In php.ini make sure that the value of extension_dir is set to this:

extension_dir = "C:\php\ext\"

In the Windows Extensions section, remove the semicolon from the
beginning of these lines:

;extension=php_mbstring.dll
;extension=php_mysql.dll

Add another line to the list like this:

extension=php_mysqli.dll

Save php.ini and restart your webserver. If you run phpinfo(), mysql and
mysqli should now appear in the list of extensions in the lower half of
the page.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Participant
August 20, 2006
C:/php/php.ini

that is where i have php installed and where the file is.
Inspiring
August 12, 2006
Bongo_Bob wrote:
> I am working through the Training from the source Dreamweaver 8 with ASP,
> ColdFusion and PHP book and when I try to setup the database connection it
> fails with an erro that says "Your PHP server doesn't have the MySql module
> loaded or you can't use the mysql_(p)connect functions".

Pity you didn't use my book instead - it tells you what to do. Still,
I'm a nice guy, so...

You need to enable the MySQL and MySQLI extensions in PHP. Open php.ini,
and search for the section marked Windows extensions. Remove the
semicolon from the beginning of these lines:

;extension=php_mbstring.dll
;extension=php_mysql.dll

Add another line like this:

extension=php_mysqli.dll

Also make sure that the extension_dir setting in php.ini points to the
ext subfolder of your PHP folder. I have installed PHP in C:\php5, so
the setting looks like this:

extension_dir = "C:\php5\ext"

Save php.ini and restart Apache. Run phpinfo(), and check that mysql and
mysqli are listed in the PHP configuration (they're quite a long way down).

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Correct answer
August 12, 2006
David -

Wow, thank you, thank you, thank you! That did it. I already tried a couple of those steps except for the php_mbstring.dll and I (and my colleague who was helping me) totally missed the quotes around the path to the ext folder, duh :(

Thanks again

Bongo_Bob