PHP5.3.0中原来不能用zend_extension_ts这种扩展方式实现了, 在网上找了很久,一直以为自已弄错了, 没有到在官方的文档中找到了。
Precompiled Modules
There are a few precompiled modules for Windows, they are all for the non-debug version of PHP. See the links on the right side.
Installing the precompiled modules is easy. Just place them in a directory, and add the following line to php.ini: (don't forget to change the path and filename to the correct one — but make sure you use the full path)
zend_extension_ts="c:/php/modules/php_xdebug-4.4.1-2.0.5.dll"
From PHP 5.3 onwards, you need to use zend_extension and not zend_extension_ts.
Compiling
You compile Xdebug separately from the rest of PHP. Note, however, that you need access to the scripts 'phpize' and 'php-config'. If your system does not have 'phpize' and 'php-config', you will need to compile and install PHP from a source tarball first, as these script are by-products of the PHP compilation and installation processes. (Debian users can install the required tools with apt-get install php4-dev, or apt-get install php5-dev). It is important that the source version matches the installed version as there are slight, but important, differences between PHP versions. Once you have access to 'phpize' and 'php-config', do the following:
1. Unpack the tarball: tar -xzf xdebug-2.0.5.tgz. Note that you do not need to unpack the tarball inside the PHP source code tree. Xdebug is compiled separately, all by itself, as stated above.
2. cd xdebug-2.0.5
3. Run phpize: phpize (or /path/to/phpize if phpize is not in your path). See in the table below which version numbers it should show for different PHP versions. Make sure you use the phpize that belongs to the PHP version that you want to use Xdebug with.
4. ./configure --enable-xdebug (or: ./configure --enable-xdebug --with-php-config=/path/to/php-config if php-config is not in your path).
If this fails with something like:
../configure: line 1960: syntax error near unexpected token
`PHP_NEW_EXTENSION(xdebug,'
../configure: line 1960: ` PHP_NEW_EXTENSION(xdebug, xdebug.c
xdebug_code_coverage.c xdebug_com.c xdebug_handler_gdb.c
xdebug_handler_php3.c xdebug_handlers.c xdebug_llist.c xdebug_hash.c
xdebug_profiler.c xdebug_superglobals.c xdebug_var.c usefulstuff.c,
$ext_shared)'
then it means that you do not meet the PHP 4.3.x version requirement for Xdebug.
Another problem that might occur is:
configure: line 1145: PHP_INIT_BUILD_SYSTEM: command not found
configure: line 1151: syntax error near unexpected token `config.nice'
configure: line 1151: `PHP_CONFIG_NICE(config.nice)'
You will need to upgrade your autotools (autoconf, automake and libtool) or install the known working versions: autoconf-2.13, automake-1.5 and libtool-1.4.3.
5. make
6. cp modules/xdebug.so /to/wherever/you/want/it
Configure PHP to Use Xdebug
1. add the following line to php.ini: zend_extension="/wherever/you/put/it/xdebug.so" (for non-threaded use of PHP, for example the CLI, CGI or Apache 1.3 module) or: zend_extension_ts="/wherever/you/put/it/xdebug.so" (for threaded usage of PHP, for example the Apache 2 work MPM or the the ISAPI module). Note: In case you compiled PHP yourself and used --enable-debug you would have to use zend_extension_debug=. From PHP 5.3 onwards, you always need to use zend_extension and not zend_extension_ts.
2. Restart your webserver.
3. Write a PHP page that calls 'phpinfo()' Load it in a browser and look for the info on the Xdebug module. If you see it next to the Zend logo, you have been successful! You can also use 'php -m' if you have a command line version of PHP, it lists all loaded modules. Xdebug should appear twice there (once under 'PHP Modules' and once under 'Zend Modules').
Compatibility
Xdebug does not work together with the Zend Optimizer or any other Zend extension (DBG, APD etc). This is due to compatibility problems with those modules. We will be working on figuring out what the problems are, and of course try to fix those.
phpize Output Table
PHP Version: PHP Api Version: Zend Module Api No: Zend Extension Api No: Recommended version:
4.4.x 20020918 20020429 20050606 2.0.5
5.1.x 20041225 20050922 220051025 2.0.5
5.2.x 20041225 20060613 220060519 2.0.5
Debugclient Installation
Unpack the Xdebug source tarball and issue the following commands:
$ cd debugclient
$ ./configure --with-libedit
$ make
# make install
This will install the debugclient binary in /usr/local/bin unless you don't have libedit installed on your system. You can either install it, or leave out the '--with-libedit' option to configure. Debian 'unstable' users can install the library with apt-get install libedit-dev libedit2.
If the configure script can not find libedit and you are sure you have (and it's headers) installed correctly and you get link errors like the following in your configure.log:
/usr/lib64/libedit.so: undefined reference to `tgetnum'
/usr/lib64/libedit.so: undefined reference to `tgoto'
/usr/lib64/libedit.so: undefined reference to `tgetflag'
/usr/lib64/libedit.so: undefined reference to `tputs'
/usr/lib64/libedit.so: undefined reference to `tgetent'
/usr/lib64/libedit.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status
you need to change your configure command to:
$ LDFLAGS=-lncurses ./configure --with-libedit
分享到:
相关推荐
**XDebug for PHP5.5:深度解析与配置指南** XDebug是一款强大的PHP扩展,专为开发者设计,用于调试和分析PHP代码。标题中的“XDebug For Php5.5”表明我们将关注的是针对PHP 5.5版本的XDebug版本。在PHP开发环境中...
**PHP_XDEBUG for Windows** PHP_Xdebug是一款强大的PHP调试工具,尤其在Windows环境下与WAMP(Windows Apache MySQL PHP)服务器组合使用时,它为开发者提供了更深入的错误检测和调试功能。Xdebug不仅有助于捕获...
7. **开发者工具**:为了高效地开发和调试PHP 5.3.0代码,可以使用IDE(如PhpStorm)或代码编辑器(如Visual Studio Code),配合Xdebug等调试工具,可以提高开发效率和代码质量。 总结起来,PHP 5.3.0 x64是一个为...
离线插件“xdebug helper for chrome”是一个专为PHP开发者设计的Chrome浏览器扩展,它提供了方便的离线安装选项,使得用户在无网络连接的情况下也能进行调试工作。这款插件的核心功能是辅助Xdebug——一个强大的PHP...
This extension is very useful for PHP developers that are using PHP tools with Xdebug support like PHPStorm, Eclipse with PDT, Netbeans and MacGDBp or any other Xdebug compatible profiling tool like ...
Xdebug是一款广受欢迎的PHP扩展,它为开发者提供了一个强大的调试和分析工具,使得调试PHP代码变得更加简单。这款开源工具由Derick Rethans开发,旨在帮助PHP开发者追踪代码执行,定位错误,以及优化应用程序性能。...
"php_xdebug.dll for php-5.4-x86-vc9" 这个标题表明我们正在讨论的是PHP的一个扩展模块——Xdebug,它是一个针对PHP 5.4版本、32位(x86)系统且构建于Visual C++ 9编译器(VC9)下的动态链接库文件(dll)。Xdebug...
备注:压缩包中的PHP8.1.1默认已经集成了php_xdebug-3.2.1-8.1-vs16-nts-x86_64.dll文件并已重命名为php_xdebug.dll。 2.配置用户环境变量 将PHP8.1所在目录添加进用户变量:D:\phpstudy_pro\Extensions\...
xdebug 安装,调试 版本php7.3.4
phpdebug工具,已经编译,2.*版本
在“ DBGp Proxy”部分,设置IDE key为"PHPSTORM",端口为9000,确保“Listen for PHP Debug Connections”选项已勾选。 4. **创建调试配置**:在PHPStorm中创建一个新的“PHP Remote Debug”配置,指定你的项目根...
标题提到的"zend调试PHP_XDebug调试PHP_zend11.0"是指在使用Zend Studio 11.0.2这个集成开发环境(IDE)时,通过XDebug工具来调试PHP代码的过程。这个过程主要涉及到以下几个关键知识点: 1. **XAMPP安装**: - ...
然后在Run > Start Listen for PHP Debug Connection监听XDEBUG的9001端口。 当在浏览器中访问项目并触发断点时,PHPSTORM会暂停执行,允许你逐行检查代码、查看变量值和调用堆栈。如果请求参数有误,XDEBUG会显示...
**Xdebug Helper 1.6.1 for Chrome 插件详解** Xdebug Helper是一款专为Chrome浏览器设计的强大调试工具,其版本1.6.1带来了更稳定和优化的调试体验,使得Web开发者能够更加高效地定位和解决问题。这款插件是Xdebug...
PHP CHROME调试插件,与Zend Studio,WAMPSERVER协同工作,方便调试
### 使用Xdebug调试PHP程序 #### 一、为何需要Xdebug? 尽管许多PHP开发者习惯于使用`echo`、`print_r()`、`var_dump()`等简单的方法来调试代码,但这些方法存在一定的局限性。例如,它们无法提供详细的错误追踪...
标题 "php_xdebug_vc11-x86_64.dll" 暗示我们讨论的是 PHP 开发中的一个关键组件,Xdebug,针对VC11编译器和64位Windows系统的动态链接库版本。Xdebug是一个强大的PHP扩展,专为调试和性能分析而设计。它提供了丰富...
《深入理解PHP Xdebug扩展与调试工具的使用》 PHP Xdebug是一款强大的PHP扩展,它为开发者提供了丰富的调试和分析功能。Xdebug是PHP社区中不可或缺的开发辅助工具,尤其对于那些致力于提升代码质量和性能的程序员来...
php7 的 xdebug 扩展