11

I know that this sounds odd, but believe me, it's what is happening. Here are my system settings:

Windows7
Apache 2.2
PHP 5.2.12
Xdebug 2.0.5

I have XDebug configured in my PHP.ini file. When I run php -m, I do in fact see that Xdebug is loaded. Now, if I start Apache AS A SERVICE (or by the Apache Monitor), and run phpinfo(), it is NOT showing Xdebug as being loaded.

However, (now here's the crazy part), if I go to my Apache bin directory, and simply run httpd.exe, and then go and look at phpinfo(), Xdebug now shows as being loaded!

Also, comparing some phpinfo() when started via service or by command line, it looks like the php.ini file is the same for either case. Everything looks the same except for the Xdebug being loaded part.

Please, if you have any ideas it would be greatly appreciated.

hakre
  • 193,403
  • 52
  • 435
  • 836
JamesD
  • 607
  • 1
  • 8
  • 22

6 Answers6

1

I recently ran into the same issue, but I had to pinhole SELinux to allow httpd access to the xdebug.so module:

chcon -v -R --type=httpd_sys_content_t /path/to/your/xdebug.so

Restarted httpd and everything worked as expected.

Mike Purcell
  • 19,847
  • 10
  • 52
  • 89
0

I had this problem and found out it was caused by having foward slashes in my php.ini instead of backslashes. So try: C:\php\ext\xdebug.dll instead of C:/php/ext/xdebug.dll

Alex
  • 928
  • 1
  • 16
  • 30
0

Mike Purcell, you had it ALMOST right...

In new Red Hat and other Linux distributions the SELinux is enabled (sucks the big one) and blocks Apache spawned childs (such as xdebug.so) from doing certain things, like accessing the web.

Thus you need to disable SElinux using:

vi /etc/selinux/config 

SELINUX=disabled

so and reboot, this will disable SE Linux and X-Debug will begin working ... Killed a whole day cause of this, hope it helps someone..

This is also how Amazon EC2 and AWS Linux servers are setup...

Sean.

born2net
  • 24,129
  • 22
  • 65
  • 104
0

I had a similar problem with Xdebug in Windows/IIS - php -m showed the module as loaded, but phpinfo() did not. Turned out to be a permissions issue - once I set the xdebug .dll to give read access to anonymous users, it started working. I'd check permissions on that .dll to make sure that whatever user Apache is running as has access to it.

Ryan Mitchell
  • 1,410
  • 1
  • 14
  • 23
0

Generally there is different configuration files for each possible way of invoking an instance of php: HTTP/CLI etc (at least this can be the case on *nix)

I would suggest doing a search on your system for php*ini and see if you have multiple files with differing/missing Xdebug settings.

0

It's possibly a buggy version/combination. I had a different issue (XDebug was not recognising some variables), the problem cleared up when I when up to 2.1.0.

http://xdebug.org/download.php

Owen
  • 7,347
  • 12
  • 54
  • 73