首页 > 代码库 > PHP配置xdebug
PHP配置xdebug
其实已经做PHP超过2年了,但是今天特别有感触,所以把过程写在这里
环境是win7+apache2.2+php5.3,因为某种原因,必须使用这个版本.
然后就死活配置不出来.apache日志如下:
[Fri Dec 23 00:23:12 2016] [notice] Parent: Received restart signal -- Restarting the server.
Failed loading php_xdebug-2.2.7-5.3-vc9.dll
8: Exit event signaled. Child process is ending.
httpd.exe: Could not reliably determine the server‘s fully qualified domain name, using 192.168.1.100 for ServerName
[Fri Dec 23 00:23:12 2016] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 23 00:23:12 2016] [notice] Digest: done
[Fri Dec 23 00:23:13 2016] [notice] Child 8608: Released the start mutex
[Fri Dec 23 00:23:14 2016] [notice] Apache/2.2.22 (Win32) DAV/2 mod_ssl/2.2.22 OpenSSL/0.9.8t PHP/5.3.29 configured -- resuming normal operations
[Fri Dec 23 00:23:14 2016] [notice] Server built: Jan 28 2012 11:16:39
[Fri Dec 23 00:23:14 2016] [notice] Parent: Created child process 14436
httpd.exe: Could not reliably determine the server‘s fully qualified domain name, using 192.168.1.100 for ServerName
[Fri Dec 23 00:23:14 2016] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Dec 23 00:23:14 2016] [notice] Child 8608: All worker threads have exited.
[Fri Dec 23 00:23:14 2016] [notice] Child 8608: Child process is exiting
Failed loading php_xdebug-2.2.7-5.3-vc9.dll
httpd.exe: Could not reliably determine the server‘s fully qualified domain name, using 192.168.1.100 for ServerName
[Fri Dec 23 00:23:15 2016] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 23 00:23:15 2016] [notice] Digest: done
[Fri Dec 23 00:23:16 2016] [notice] Child 14436: Child process is running
[Fri Dec 23 00:23:16 2016] [notice] Child 14436: Acquired the start mutex.
[Fri Dec 23 00:23:16 2016] [notice] Child 14436: Starting 64 worker threads.
[Fri Dec 23 00:23:16 2016] [notice] Child 14436: Starting thread to listen on port 80.
然后经过网上好一顿查,大概花了三个小时,终于找到一个工具
https://xdebug.org/wizard.php
这工具只要把phpinfo()打印出来的东西,复制进去,就能告诉你为什么xdebug加载不了。
得到的回复我没有保存下来,但我通过这个知道,我的apache是vc9编译的,我选的是thread(也就是线程安全),然后虽然我是64位系统,但我的apache是32位的。
然后我就去xdebug官网下载了适合的版本。终于xdebug出现了。
最后。这地方我不知道网上为什么大部分教程这个地方都是文件名而不是路径,我的没有路径是行不通的。
zend_extension=C:\Develop\php53\ext\php_xdebug-2.2.7-5.3-vc9.dll
xdebug.profiler_enable=on
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.show_exception_trace = On
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.collect_vars = On
xdebug.remote_handler = dbgp
xdebug.remote_host= localhost
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
感触
1:重点是开源项目一定要读文档,无论多大年纪,只要想做编程,就要好好学英语!
2:使用软件,如果出问题,一定要查日志,切记切记!
3:成熟软件没有解决不了的问题,一定要耐心,切记切记!
PHP配置xdebug