Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can not connect to MySql with PHP in Dreamweaver

Guest
Aug 12, 2006 Aug 12, 2006
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
TOPICS
Server side applications
3.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Aug 12, 2006 Aug 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
Translate
LEGEND ,
Aug 12, 2006 Aug 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 12, 2006 Aug 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 12, 2006 Aug 12, 2006
Bongo_Bob wrote:
> Wow, thank you, thank you, thank you! That did it.

Glad to have sorted it out for you so quickly.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2006 Aug 17, 2006
i wish i could say the say i get the same error but have found that extension=php_mysqli.dll extension does not exist its PHP Version 4.3.3 iom using at the moment and
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.49


Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout -1 -1
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off


I cannot find that part in the PHP info page but phpmyadmin connects just fine hope you can help 🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2006 Aug 18, 2006
whatsthepoint2005 wrote:
> i wish i could say the say i get the same error but have found that
> extension=php_mysqli.dll extension does not exist its PHP Version 4.3.3 iom

PHP 4 does not support MySQLI, so you don't need it. MySQL Improved is
available in PHP 5 only.

> I cannot find that part in the PHP info page but phpmyadmin connects just fine
> hope you can help :)

You don't say what help you need. I presume that the problem is
connecting from Dreamweaver. If you are using a recent version of MySQL,
the client libraries in your version of PHP are out of date. Try
downloading the new ones from the MySQL site:

http://dev.mysql.com/downloads/connector/php/

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2006 Aug 18, 2006
Ok so what about this server should i be able to connect to it (ITS NOT LOCAL)

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 1
Client API version 4.1.21
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

System Linux cupar.just4dns.com 2.6.9-22.ELsmp #1 SMP Sat Oct 8 19:11:43 CDT 2005 i686
Build Date Jun 6 2006 23:26:48
Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-imap=/usr/local/imap-2004g' '--with-mcrypt' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pspell' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--with-zlib'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606

as i get the same error with this and another linux LAN server upto date using yum php version 4.3 though
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2006 Aug 18, 2006
whatsthepoint2005 wrote:
> Ok so what about this server should i be able to connect to it (ITS NOT LOCAL)
>
> mysql
> MySQL Support enabled
> Active Persistent Links 0
> Active Links 1
> Client API version 4.1.21

Yes, you should be able to connect. However, it depends on the version
of MySQL that's running. It's possible that your remote version of MySQL
is 4.1 and the password authentication setup is wrong. See this
explanation in the MySQL documentation:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 19, 2006 Aug 19, 2006
david,
hope you are able to answer this. i am getting the same message as bongo_bob, and i followed your instructions you gave to him to try to fix the problem. unfortunately i still do not have mysql loaded (and using the phpinfo.php script to see, and mysql does not show up there). i am running on windoze xp, php 5.1.5, apache 2.0.59 , and mysql 5.0.24. any help would be most appreciated.
steve
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 19, 2006 Aug 19, 2006
slw13 wrote:
> david,
> hope you are able to answer this. i am getting the same message as bongo_bob,
> and i followed your instructions you gave to him to try to fix the problem.
> unfortunately i still do not have mysql loaded

When you run phpinfo() what does it say in Configuration File (php.ini)
Path? It's about the sixth item from the top.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2017 Jun 09, 2017
LATEST

Thanks so much. it worked for me. thumbs up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 19, 2006 Aug 19, 2006
C:/php/php.ini

that is where i have php installed and where the file is.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 20, 2006 Aug 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 30, 2006 Aug 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines