PHPIniDir broken under windows 7?

delete last slash:

PHPIniDir "C:\Program Files (x86)\php"

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.


There are several reasons:

  • Old version of Apache and/or PHP. Apache 2.2.13/2.2.14 seem to work fine in Windows 7, as well as PHP 5.2.11/5.3.
  • Some of PHP extensions may cause the Apache startup failure. You may either check Apache's log files or enable 'display_startup_errors' in php.ini (when it's enabled you may use ApacheMonitor.exe to start or stop the Apache service, and if an error occurs, it'll display a message). You may also disable all PHP extensions and if it helps start enabling them one by one and see which one is causing the problem.
  • Imho, make sure you've downloaded an archive of PHP and didn't use the automated installer. In my experience, installers never worked well. You can always add two PHP-related directives (PHPIniDir and LoadModule) into Apache's config file and make sure PHP dir is included in Windows' path. Oh, and service error may also be caused by php2apache library.
  • Check if Apache/PHP/MySQL directories are included into Windows' path. Here is a good utility to do that: Redmond Path. You may add the following directories into the path: Apache/bin dir, PHP dir, MySQL/bin dir. It might help.