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

Connecting to a MySql DB in DW MX2004

Guest
Aug 23, 2006 Aug 23, 2006
I have MySql v. 5.0.24 and PHP v. 5.1.5 running on Windows XP Pro. I am using the IIS web server. The PHP tests fine using a simple clock program. My problem is that I can’t connect with the MySql database using Dreamweaver MX 2004. I get "An unidentified error has occurred." I have tried older versions of MySql to no avail. Please help, I must get this to work.

Thanks.



TOPICS
Server side applications
772
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 23, 2006 Aug 23, 2006
rpbsr wrote:
> I get "An unidentified error has occurred." I have tried older
> versions of MySql to no avail. Please help, I must get this to work.

This question gets answered several times a day.

Is your website in C:\Inetpub\wwwroot or a subfolder? Or have you
created a virtual folder for it in IIS?

In the Site definition, the Testing server should be set to the following:

Server model: PHP MySQL
Access: Local/network
Testing server folder: the actual location (but it must be inside
wwwroot or a defined virtual folder)
URL prefix: http://localhost/name_of_site_folder/

--
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 23, 2006 Aug 23, 2006
David,
Thank you for getting back so quickly. My website is in a subfolder of wwwroot called MySampleApp.

Testing server folder: C:\Inetpub\wwwroot\MySampleApp\
URL prefix: http://localhost/MySampleApp/

I'm following the Dreamweaver tutorial to the letter (I think). What can be wrong? I'll try anything else you can suggest.

Thanks,

Robert
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 23, 2006 Aug 23, 2006
rpbsr wrote:
> David,
> Thank you for getting back so quickly. My website is in a subfolder of
> wwwroot called MySampleApp.
>
> Testing server folder: C:\Inetpub\wwwroot\MySampleApp\
> URL prefix: http://localhost/MySampleApp/

That should be OK. Since you're using MySQL 5.0, the problem could be
with the PHP authentication protocol when connecting to MySQL. Open
php.ini and remove the semicolon from the beginning of this line:

;extension=php_mbstring.dll

Also add this line:

extension=php_mysqli.dll

Save php.ini and restart IIS.

--
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 23, 2006 Aug 23, 2006
David,

It still fails to connect. I rebooted the computer after making the changes to start fresh (I assume that also restarts IIS). Worse now is that when I try to run the little "timetest.php" application the DW tutorial suggests to test PHP, I get the following:
Fatal error: Call to undefined function datee() in c:\Inetpub\wwwroot\timetest.php on line 2
PHP Warning: PHP Startup: Unable to load dynamic library './php_mysqli.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_mbstring.dll' - The specified module could not be found. in Unknown on line 0. This little test app worked before.

Please let me know if there something else to try.

Regards,
Robert
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 24, 2006 Aug 24, 2006
rpbsr wrote:
> Fatal error: Call to undefined function datee() in
> c:\Inetpub\wwwroot\timetest.php on line 2

There is no function datee(). It's called date().

> PHP Warning: PHP Startup: Unable to load dynamic library './php_mysqli.dll' -
> The specified module could not be found. in Unknown on line 0 PHP Warning: PHP
> Startup: Unable to load dynamic library './php_mbstring.dll' - The specified
> module could not be found. in Unknown on line 0.

That means PHP and Windows are not set up correctly. Assuming that PHP
is in C:\php, you need to make sure that the extension_dir setting in
php.ini points to the ext folder:

extension_dir = "C:\php\ext"

You also need to add PHP to the Windows path. Open Control Panel and
double-click System. Select the Advanced tab and click Environment
variables. In the bottom pane of the dialog box that opens, select PATH
and click Edit. Edit the path to add a semicolon followed by the PHP
folder at the end.

Restart your computer.

--
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 24, 2006 Aug 24, 2006
I still have the DW connection problem. I added the extension_dir = "C:\php\ext"
to the windows extensions in the php.ini. Neither this, nor the two dlls in your prior message are preceded by semicolons. Since I did not have an "ext" subfolder in my C:\php folder, I created it. I added ;C:\php to the path in System and restarted the machine as suggested.

I made the correction to the php code for the DW timetest.php code and opened it using localhost. Below is the result:

This page was created at 12:55:36 pm on the computer running PHP.

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_mysqli.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_mbstring.dll' - The specified module could not be found. in Unknown on line 0
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 24, 2006 Aug 24, 2006
rpbsr wrote:
> Since I did not have an "ext"
> subfolder in my C:\php folder, I created it.

That's not going to do a great deal of good if there are no files inside
it. The whole point of setting the value of extension_dir is so that
Windows can find the dll files. Since you're using PHP 5.1.5 and IIS, it
sounds as though you have used the PHP Windows installer, which doesn't
include any extensions.

You need to go to http://www.php.net/downloads.php and download the PHP
5.1.6 ZIP package. Unzip the package and copy the contents of the ext
folder to the one you have just created.

--
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 24, 2006 Aug 24, 2006
David,

hopefully we're closing in on a solution. I still can't connect in DW. Below is what I now get when I run the little 'timetest.php' app:

This page was created at 07:25:35 pm on the computer running PHP.

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_mysqli.dll' - The specified module could not be found. in Unknown on line 0

The file php_mysqli.dll is located in the C:\php\ext subfolder.

Following are some of the lines from the php.ini:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
extension_dir="C:\php\ext"
extension=php_mysqli.dll
extension=php_mbstring.dll
;extension=php_bz2.dll
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 25, 2006 Aug 25, 2006
rpbsr wrote:
> extension_dir="C:\php\ext"
> extension=php_mysqli.dll
> extension=php_mbstring.dll
> ;extension=php_bz2.dll

Some extensions need to be loaded in a specific order. You'll notice
that php_mbstring.dll is the very first one listed in the original
php.ini. It's there for a reason. Move php_mysqli.dll below it, and it
will probably work.

--
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 25, 2006 Aug 25, 2006
LATEST
I switched the extentions; they are now:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
extension_dir="C:\php\ext"
extension=php_mbstring.dll
extension=php_mysqli.dll
;extension=php_bz2.dll
;extension=php_curl.dl

Still no connection to the database and the result with the timetest.php is the same as my last post. Please keep trying.

Thanks,
Robert
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