After following the installation instructions for Drupal/PHP/MySQL for a Windows/IIS platform, any attempt to get the Drupal home page (index.php) results in the html message:
"PHP MySQL support not enabled
We were unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your PHP.ini to see how you can enable it."
We are using Drupal 5.1/PHP 5.2.3/MySQL 5.0.41. We noticed this error was posted previously (about 18 weeks ago), but the solution given did not help us. We get this same error on Windows Server 2003 with service pack 2 and Windows XP Media Center Edition with service pack 2. We get the error whether all files are installed on the System partition or on different partitions.
We used the installation procedure in the Drupal manual for a standalone config on Windows/IIS. We have made the following changes to the php.ini file that came with the php-5.2.3-win32-installer.msi package:
1. set doc_root to the Drupal base directory
2. set extension_dir to the PHP\ext directory
3. uncommented extension=php_mysql.dll
4. set mysql.default_port, mysql.default_host, mysql.default_user, mysql.default_password to the values specified when the Drupal database was created. (Note:internal system - security not an issue)
The MySQL extension for PHP is in the PHP\ext directory. The path to the directory and the extension are specified in the php.ini file.
What am I missing here? Is it possible the php5isapi.dll is not reading the php.ini file?
Thanks in advance,
Joe
Comments
Good troubleshooting info ;)
Good troubleshooting info ;)
It is entirely possible. Where is your php.ini ? On windows install it may be in (at least) any of three places ... but only one of which will actually take effect ... :-}
- in the php executable dir?
- in the apache executable dir?
- in an apache conf folder?
- in c:\windows ?
SO. Enable a phpinfo page.
That will enable you to check to see WHICH php.ini file is actually used, which extension_dir is being searched, and which extensions are actually active.
Try that. Expect a "Doh, arrg!" moment.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Troubleshooting info
Dan,
You were absolutely correct in that php5isapi was looking for the ini file in C:\windows and I had it in the php directory. Unfortunately though, this did not correct my problem. I still get the same message. Would I get a different message if the database created for Drupal was somehow inadequate? Note I'm using IIS6 as the web server, not Apache.
Regards,
Joe
extension
The message is not yet about the database itself, it's about the fact that the MYSQL extension is not available.
Your PHPinfo should have listed the version number of the active MYSQL extension. I'm thinking it didn't.
You need to ensure that the extension_dir is correct, and the named .dll file is in it.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Extension
Dan,
The extension_dir="C:\Program Files\PHP\ext" and the php_mysql.dll is indeed present in that directory.
The phpinfo listing shows loaded configuration file as (none), even though the configuration path is C:\windows and the php.ini file is in the C:\windows directory. Do I need to have the php.ini file in more locations than C:\windows and C:\Program Files\PHP?
Regards,
Joe
Sorry, I've not got an IIS
Sorry, I've not got an IIS install, and I'm pretty sure my win/Apache setups started working at about that stage.
I guess you could try some commandline stuff to ensure your php.ini is being parsed correclty, but really can't suggest much more. You tried c:\progra~1\PHP instead of the path with a space in it?
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
PATH
Wondering if it could be a Windows issue. Try putting your \php and \ext folders in the global PATH statement.
This would also allow you to leave php.ini in the \php folder; much easier to upgrade.
UPDATE:Location of global PATH statement?
TM,
I found how to locate the global variable PATH in the system environment variables on Windows XP via the Control Panel | System | Advanced tab. C:\Program Files\PHP was already specified right at the front of the variable value. I have the php.ini file in this directory as well as C:\Windows. PHP did find the php.ini file in the directory specified in the PATH variable after I restarted the system. However we got an error %1%2 indicating the device driver could not be loaded. I'm presuming this is referring to the php_mysql.dll file. I set the php directory & php/ext web sharing permissions to allow write/execute and made few changes in the php.ini file mostly around error handling to get more info. No progress with this trial & error approach yet.
Thanks,
Joe
Try adding the path for the ext folder
Okay, now try adding the path to the ext folder to the PATH variable. In your case, this should be "C:\Program Files\PHP\ext". Don't forget the semicolon separator. This should help Windows find the dll. Yes, Windows is a finicky beast.
You may also wish to try this setting in php.ini; "extension_dir = "./ext/"" (only requires an Apache restart).
Good luck!
MySQL dll Access Resolved
tm,
After adding the ext directory to the global path variable we were able to eliminate the original error. The index.php page now produces a blank page but completes ok (code 200) and there are no errors in the system log or application log. We did not change extension_dir as you suggested because we are running on IIS6, not Apache.
We are not out of the woods yet, but I think this is progress. :)
I'm not sure the includes of bootstrap.inc has run in index.php as there is no content/structure in the DrupalDB in MySQL. Do we need to specify the include_path variable in php.ini to point to the Drupal include directory?
Thanks,
Joe
If there was no structure in
If there was no structure in the DB, Drupal would have detected that and sent you to the setup bootstrapping page. It's got quite a nice installer nowadays.
A blank page with no errors (200 or not) is still not great, or expected.
Have you tried visiting update.php ? Enter the URL manually.
If the includes were failing, you'd have seen other errors.
Checking your phpinfo shows the current directory '.' as one of the entries in include_path should be sufficient.
Sounds like you're not having much fun with this setup :-/
I am perplexed that the PHP install, which managed to include the PHP bin directory to your PATH, didn't do the same for the ext directory ... if this really is required.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Results from running update.php
Dan,
Yes, this install has been a nightmare. If it wasn't for the perceived benefits of Drupal I would have aborted this attempt long ago.
I decided to focus on the Windows Server 2003 install. I'm currently getting Error 404 when I try to run index.php. I get a warning in the system log from PHP 5.2.3 = "Module 'mysql' already in Unknown on line 0", but no other error messages.
I specified the include_path = ".;F:\Drupal\includes" in php.ini thinking the include files were not getting loaded. The 404 still occured and the DrupalDB contents were still empty.
Today I ran update.php per your suggestion and get multiple displays of this same error message:
"Warning: Table 'drupaldb.watchdog' doesn't exist query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'Table 'drupaldb.system' doesn't exist\nquery: SELECT name, schema_version FROM system WHERE type = 'module' in F:\\Drupal\\includes\\database.mysql.inc on line 172.', 2, '', 'http://jcl-cpq2500:83/HAI/update.php', '', '66.215.57.200', 1184089318) in F:\Drupal\includes\database.mysql.inc on line 172"
followed by a section with red background listing a slew of tables that don't exist.
I haven't studied the php script files in great detail. but whichever script creates the table structure in the DrupalDB doesn't run.
I can connect to the drupaldb from the MySQL Query Browser. Now I can see that 3 cache tables (filter, menu, page) have been created by update.php, but that's it.
I guess it's possible a required includes file is missing from my setup. Is there a list somewhere of all the files needed?
Regards,
Joe
try this
If update.php attempts to connect (and obviously does have the right credentials in order to notice that the tables are not there) then the creation failed to happen at some earlier time.
One way I've found to try again is to unset (comment) your (correct) mysql connection string, replacing it with the default 'username:password@localhost' version from above.
Next time you visit Drupal Install.php it will think it's a brand new site, and try to bootstrap itself from scratch again.
It'll ask for login details again, so just tell it again.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
An option
Sorry, been out of sorts lately...
An option; since you control the host, and the database is currently unpopulated (if it is not, you can delete all the tables), maybe you can just dump your current Drupal folder and start over. Assuming phpinfo() works (which should indicate that all your pieces are in place, including mysql or mysqli. An instruction for creating a test.php file is at http://drupal.org/node/268), the installation should work correctly this time. Don't forget to add the \files folder in Drupal root before starting the install (avoids a warning).
There is an assumption by the Drupal installation that your environment (WIMP, in your case) is set and verified. I use phpmyadmin to verify; if I can install it without errors and can manage the databases, I am (usually) good to go.
You may wish to check out the Handbook section on installing Drupal at http://drupal.org/node/260.
Welcome to your new Drupal website achieved!
tm,
Ok, I went back and reviewed http://drupal.org/node/260 again. We're running Drupal in a virtual directory not on the systems disk (C drive). When I ran install.php directly I received the message: "Congratulations, Drupal has been successfully installed."
I then followed the link provided to the "Welcome to your new Drupal website!" page with the 5 step process to complete the site setup.
I may have additional problems down the road, but hopefully the worst is over. Many thanks to you and Dan for staying with me on this!
Regards,
Joe
Very good!
You may want ensure that index.php is the default handler for your Drupal site. If you are running a virtual site in IIS, this should not be a problem, since it is rooted.
I run an AD network, but I still try to avoid IIS if I can, unless it it MS-related (like WSUS). Also using Apache and Weblogic in production, so it gets really confusing, and I am getting old.