views:

22

answers:

1

I have the following problem. When I state some extensions in my php.ini and try to restart Apache it refuses to work. I assume that I have made a mistake in my extension_dir or in adding extensions themselves. When I run a server with an extension path and no extensions set, all works fine and I get my phpinfo page. But when extensions are set, server refuses to start.

Here's my extensions path:
...
; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\PHP\ext"
...


And the extensions:
...
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;extension=php_mysql.dll
;extension=php_mysqli.dll
extension=php_bz2.dll
...


Any suggestions?

A: 
  • Check Apache's error log
  • Configure PHP to show all errors and check its error log
  • Narrow down the problem
    • What settings did you change?
    • Is it a specific extension that PHP chokes on? Try enabling one at a time.
    • If zero extensions work, then PHP cannot find the directory
      • Make sure the directory is correct and exists
      • Try using double-backslashes (or even forward-slashes) in the ext path
Tim
Log just states the fact that Apache could not restart,extensions are in the folder, and I tried all path combinations that I know.
sandman
Would you mind copying and pasting the error from the log, along with anything else that looks interesting?
Tim
The Apache2.2 service is restarting.Failed to restart the Apache2.2 service.t: Received restart signal -- Restarting the server.
sandman
I assume this is a new Apache server setup? What modifications have you made to either php.ini or httpd.conf?
Tim
No modifications that go beyond basic manuals. In php.ini I modified only the fields that I mentioned in the question, and in httpd.conf there are only basic additions made by PHP .msi installer.
sandman
Try setting error_reporting=-1 in php.ini to show all errors. Then (try to) start Apache, and check (1) the Apache error log and (2) PHP's error log.
Tim
Where should I look for php log?
sandman
Check the error_log directive in php.ini; you might want to set it to something like "C:\php_error.log" for now. After setting error_reporting, /hopefully/ Apache will show PHP's initialization errors in its own log. When I faced a similar situation, I had 'PHP Warning' errors in my Apache log complaining about the specific extension that was causing problems.
Tim