开发者

No xdebug in phpinfo()

开发者 https://www.devze.com 2023-01-17 08:27 出处:网络
I have added following lines into php.ini [XDebug] zend_extension = C:\\PROGRA~1\\PHP5\\ext\\php_xdebug-2.1.0-5.3-vc9.dll

I have added following lines into php.ini

[XDebug]
zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Version of php_xdebug-2.1.0-5.3-vc9.dll is obtained via page http://www.xdebug.org/find-binary.php.

But there are no any mentions of '开发者_JAVA百科xdebug' string in output of phpinfo().

What can be wrong?

(This is my second fight with php-xdebug to get working, first time I gave up. If you have other suggestions concerning debugging please add them also, possibly as comments to the question. I would like to following scenario work under windows: "Set up break point, run my script, it stops on break point and I can see the value of some variable". Thanks)

UPDATE

Restart of Apache does not resolve the issue. In log file the message appears:

Apache/2.2.14 (Win32) PHP/5.3.1 configured - resuming normal operations


check the top of the output of

php -m

for me it showed an error in php.ini, after solving that xdebug was loaded.


zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll

should be replaced by

zend_extension="C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll"

P.S. Will e-mail xdebug guys.


This worked for me (vscode, xampp) Go to https://xdebug.org/wizard.php and paste the contents of phpinfo()

Then download the right xdebug.dll and place it in your 'ext' folder.

Add the following to your php.ini

[XDebug]
zend_extension="php_xdebug-2.5.4-7.0-vc14.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1


I just had the same problem, nothing of this worked for me. I started php in the console and I saw, php was unable to load the dll from the given path. The solution for me was to omit the path information and only load it like this:

zend_extension="php_xdebug-2.2.5-5.5-vc11.dll"


You can follow this tutorial on getting started with xdebug : http://devzone.zend.com/article/2803-Introducing-xdebug

Xdebug and ZendDebug are two separate debuggers, it's up to you to decide which one to use. Either one is pretty easy to setup. Only a couple of steps in Eclipse.

Post the content from your php info page into this page to find out which version to download : http://www.xdebug.org/find-binary.php


I was just struggling with this myself and found a way to identify (and solve) the problem. It works on Xampp and Windows 7 at least.

In my case the problem was dots. Renaming "php_xdebug-2.2.5-5.5-vc11.dll" to "php_xdebug.dll" did the job.

Another pro-tip is that newer versions of Xampp have Xdebug built-in, so you don't need to donwload it, just edit php.ini with:

zend_extension = "path\to\php\ext\php_xdebug.dll"
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1 (or localhost)
xdebug.remote_port = 9000
xdebug.remote_mode = req

Then restart the apache and it should work. The advantage of using xampp built-in xdebug is that it's most likely the right version.


Writing in January 2019, I found that following the Xdebug Wizard at Xdebug wizard here

exactly, including using their download link to the correct version of Xdebug for your version of PHP and copying the line to insert on your php ini exactly as is, got Xdebug appearing in phpInfo for me. I was installing into Laragon . Running php -m from the command line gave a good confirmation of all being well, with Xdebug loading as a Zend Extension. Usual gotchas about needing to restart server etc apply.


In my case, Xdebug is showing in php -m, php -i but not in phpinfo() result.

Restarting Apache didn't help until restarting php-fpm

systemctl restart php-fpm.service


Its happen because of permission. you have to add the permission of that specific app/user profile from the folder's Properties Security tab.

I use PHP with IIS server so. It worked for me by adding IIS_USER in security permission.


in my case the issue was the php.symlink file in the C:\wamp64\bin\apache\apache2.4.23\bin folder , this file links to the php.ini file existed in C:\wamp64\bin\php\php5.6.25 but apparently it wasn't working so i've deleted it and copy paste the actual php.ini to the same folder and it worked.

if you want to return the php.symlink back open cmd in the C:\wamp64\bin\apache\apache2.4.23\bin and write the following (windows):

mklink php.ini C:\wamp64\bin\php\php5.6.25\php.ini

replace the path to point to your php.ini inside your php file


Just for the newbees:

If you want to check if the .dll, specified in the php.ini is loading properly:

  1. Add php to the Windows Runtime Directory. For win10, refer to this post https://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path-environment-variable/

  2. From the Windows command prompt, type php -m and check if any error is displayed.


In my case the issue was the file path which apache loaded, the file php.ini I changed is not the current loaded config, so check it First.


xdebug appears in "php -m" command line BUT nothing on the browser <?php phpinfo(); page ! Check in httpd.conf PHPIniDir "C:/to/the/RIGHT/phpversion" The command line php.exe use the Environment PATH variable but nut the apache !

0

精彩评论

暂无评论...
验证码 换一张
取 消