phpapacheapache2apache-config

PHPIniDir broken under windows 7?


I had a server running on a Windows XP machine using Apache2 with PHP and MySQL. I've recently upgraded to Windows 7 and have been having trouble getting it to work. Apache works fine and PHP works, but I can't seem to get it to work with a php.ini file.

When I set PHPIniDir to a directory with a php.ini file, the Apache service does NOT start.

When I set PHPIniDir to a directory with NO php.ini file, the Apache service does start.

When I leave out PHPIniDir, the Apache service does not start.

Has anyone found a fix for this problem? Thanks!

EDIT :

PHPIniDir "C:\Windows" #works (no php.ini file)

PHPIniDir "C:\Program Files (x86)\php\" #does not work (contains php.ini file)

I enable at most one at any given time.


Solution

  • I had the same problem. I fixed it. Open php.ini file with a notepad or any text editor. Disable all of the extension in php.ini file. Comment extensions by one by, and find out which extension causes the problem.