xdebug 配置教程

https://my.oschina.net/botkenni/blog/979090
环境:



  Dev 服务器(IP:192.168.2.100),安装phpstorm,用来做开发任务!



  Server服务器(IP:192.168.2.222),web服务器(php架构),用来浏览网页用!



这里的两台服务器在同一个网段下,可以互通!

在Server服务器上的php.ini里配置xdebug如下:
[xdebug]



zend_extension=/opt/php5/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so



xdebug.remote_enable=1



xdebug.remote_handler=dbgp



xdebug.remote_mode=req



xdebug.remote_host=192.168.2.100



xdebug.remote_port=9000



xdebug.idekey=”PHPSTORM”



remote_host参数的值填写Dev 服务器(开发机器)的IP地址。



remote_port填写9000,只要没有被其它程序占用,就可以了,可以不是9000。



接下来开始设置phpstorm的参数:



快捷键(Ctrl + Alt + S)打开窗口:



打开phpstorm的配置对话框,找到Languages & Frameworks  » PHP »Debug 窗口



这里填写的Debug port为:9000,与php.ini里配置的端口号保持一致!



接下来点选Server选项,点击绿色的 “+” 新建Server,并根据如下设置填写你相对应的内容!



https://my.oschina.net/botkenni/blog/979090



https://github.com/php/php-src



cts/c/php-src$./buildconf
buildconf: checking installation…
buildconf: autoconf version 2.69 (ok)
rebuilding aclocal.m4
rebuilding configure
rebuilding main/php_config.h.in



$./configure –enable-debug
checking for grep that handles long lines and -e… /usr/bin/grep



$make -j4



https://www.php.net/install



$ make install
Installing shared extensions: /usr/local/lib/php/extensions/debug-non-zts-20160303/
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/php/man/man1/
Installing phpdbg binary: /usr/local/bin/
Installing phpdbg man page: /usr/local/php/man/man1/
Installing PHP CGI binary: /usr/local/bin/
Installing PHP CGI man page: /usr/local/php/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/



You may want to add: /usr/local/lib/php to your php.ini include_path
/Users/didi/PhpstormProjects/c/php-src/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f phar.phar /usr/local/bin/phar
Installing PDO headers: /usr/local/include/php/ext/pdo/



$git checkout php-7.1.0beta3



$git branch



  • (HEAD detached at php-7.1.0beta3)
    master
    xiazemin/etf



$./buildconf
You should not run buildconf in a release package.
use buildconf –force to override this check.



$./configure –enable-debug
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E



$make -j4



make: *** [ext/phar/phar.php] Error 139



$sudo vi /etc/ld.so.conf
在里面加上一行
/usr/local/lib
然后运行/sbin/ldconfig
make



make: *** [ext/phar/phar.php] Error 139



./configure –with-iconv=/usr/local/opt/libiconv



make clean
./configure –enable-debug
make j4
make test



https://www.php.net/install


Category php