11

I'm at a loss. I'm on WIndows 7 and have installed both Apache 2.2.21 and PHP 5.2.17. I can not enable the mysql module. Is there a known issue on Windows 7?

I've run php --info and see the following:

C:\php>php --ini
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         C:\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

I've also set my extension dir inside php.ini:

extension_dir = "C:\php\ext"

I've also added an entry to my httpd.conf file:

# configure the path to php.ini
PHPIniDir "c:/php"

And yes, inside my php.ini file I've enabled the php_mysql extension and restarted my web server.

What am I missing?

12
  • Did you make sure that the MySQL extension is in the extensions folder? Commented Feb 17, 2012 at 14:05
  • 1
    what does your phpinfo() say ? Commented Feb 17, 2012 at 14:06
  • yes I did also verify that... Commented Feb 17, 2012 at 14:06
  • Stewie: My phpinfo shows the correct locations etc for my ini file but I don't see the mysql module loaded Commented Feb 17, 2012 at 14:07
  • Do you have extension = mysql.dll as well? PHP won't auto-load everything in the extension directly, only the .dlls you explicitly list. Commented Feb 17, 2012 at 14:09

5 Answers 5

4

Have you tried forward slashes here?

extension_dir = "C:/php/ext"

It worked for me.

Sign up to request clarification or add additional context in comments.

1 Comment

Forward slashes didn't matter on the Win 7 machine I'm working on but giving the full path to the "ext" dir did.
3

Have you tried putting php_mysql.dll in C:\windows\system32 directory? If you place the file there, restart your webserver and the module is loaded, then it could mean an environment variable issue, or an old version of php_mysql.dll is preventing the new one from being loaded properly.

Comments

0

Note to any future information seekers, that mysql extension is deprecated in 5.5 and is gone by PHP 7, to be replaced my the mysqli extension.

Comments

-1

Did you install MySQL? I remember I had some kind of that problem because I was expecting PHP to load MySQL extension, before installing MySQL to complete my localhost setup. The reason is when you install MySQL it puts some DLLs to system32 dir so then PHP can load it.

Comments

-1

You need php-mysql not just php. Installing that should take care of adding the right exgtensions to php.

yum install php-mysql

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.