2011-01-27 49 views
1

我试图在Linux机器上安装Xdebug以进行PHP的远程调试。我在尝试构建它时碰到过很多问题,我似乎已经解决了一些问题,但现在我感觉停滞不前。简短描述,“make”没有成功完成,说它找不到zend_config.h或TSRM_config.h。不知道如何去得到这些。尝试为PHP构建Xdebug时缺少“Make”的头文件

更深入的解释:(注意我不是超级Linux的悟性,所以如果你看到的东西,我所做的就是公然错了,请让我知道)

我试图跟随我提供的指令here提供了我的phpinfo()详细信息(请参阅文章结尾)。试图“制造”当我最初得到了一些类似这样的错误:

Error: ‘ZEND_USER_OPCODE_DISPATCH’ undeclared (first use in this function) 
Error: ‘ZEND_RAISE_ABSTRACT_ERROR’ undeclared (first use in this function) 
Etc. 

我的猜测是,它并没有与Zend的正确版本phpize'd(如果我的措辞正确)。回到phpize步骤,返回的版本不能与phpinfo()对齐。而不是看到:

PHP Api Version:   whatever 
Zend Module Api No:   20060613 
Zend Extension Api No:  220060519 

我反而看到:

PHP Api Version:   20020918 
Zend Module Api No:   20020429 
Zend Extension Api No:  20050606 

为了让事情变得更加复杂,我运行XAMPP(1.6.8a)的旧版本,让我到PHP 4.4之间切换.9和PHP 5.2.6(目前正试图在我的工作上转换PHP版本,并进行调试确实会加快速度)。我目前有PHP5模式运行。检查/ opt/lampp/bin/phpize,我发现它是“phpize-5.2.6”的符号链接。我的猜测是,XAMPP只是切换链接,取决于它被告知启动的PHP版本。无论如何,这部分看起来很好,我运行phpize-5.2.6进行了一次完整性检查,仍然得到旧版本号。现在,php-config的设置类似,运行php-config --version返回“5.2.6”,这很好。

我做了一些更多的挖掘和穿越this post(线程中倒数第二)。我最终下载了5.2.17版的PHP源代码(希望这足够接近),并创建了线程中描述的软链接。 Phpize版本现在看起来好多了,有什么Xdebug的网站说,我应该看到排队:

PHP Api Version:  20041225 
Zend Module Api No:  20060613 
Zend Extension Api No: 220060519 

“制作”现在抛出缺少头文件上面列出的错误。我看到this post并决定玩我的配置文件。

我注释掉

-no-create | --no-create | --no-creat | --no-crea | --no-cre \ <br/> 
    | --no-cr | --no-c | -n) 
    no_create=yes ;; 

并已删除这一行-no创建:

set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion 

仍然没有运气。我认为配置应该创建这些配置文件或东西?不知道接下来要尝试什么。如果有帮助,我正在运行SUSE SLES 10.谢谢。

Xdebug custom generated install instructions: 
SUMMARY 
• Xdebug installed: no 
• Server API: Apache 2.0 Handler 
• Windows: no 
• Zend Server: no 
• PHP Version: 5.2.6 
• Zend API nr: 220060519 
• PHP API nr: 20060613 
• Debug Build: no 
• Thread Safe Build: no 
• Configuration File Path: /opt/lampp/etc 
• Configuration File: /opt/lampp/etc/php.ini 
• Extensions directory: /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613 
INSTRUCTIONS 
1. Download xdebug-2.1.0.tgz 
2. Unpack the downloaded file with tar -xvzf xdebug-2.1.0.tgz 
3. Run: cd xdebug-2.1.0 
4. Run: phpize 
As part of its output it should show: 
Configuring for: 
... 
Zend Module Api No:  20060613 
Zend Extension Api No: 220060519 
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step. 
5. Run: ./configure 
6. Run: make 
7. Run: cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613 
8. Edit /opt/lampp/etc/php.ini and add the line 
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so 
9. Restart the webserver 

回答

0

所以原来运行的配置,当我需要一个额外的标志:

--enable-Xdebug的

很简单,但我用的指令从来没有提到这一点。在浏览Xdebug的讨论列表存档后才发现它。

请注意,尽管“make”似乎在第一次没有错误时正常工作,但我仍然没有在modules /中获得xdebug.so文件。然后我做了一个“make clean”,再次运行phpize,配置然后make,这次我得到了这个文件。

0

看起来您使用的是旧版本的PHP,这可能意味着您正在使用您的Linux发行版中的PHP软件包。

如果是这种情况,请首先检查您的发行版是否提供xdebug软件包。如果没有,您可能需要安装php * -dev或php * -devel包,才能构建模块。

+0

做了一些更多的挖掘,并能够在opensuse.org上为我的旧版本的SUSE找到一个软件包。尽管安装Xdebug 2.1.0-5.1,但Yast表示它需要依赖PHP 5.2.5,这实际上比我已经更老。我可能会找到它的存储库,但我在这个盒子上安装第三个PHP版本有点犹豫。我会试着抓住开发版本的源码,看看会发生什么。 – 2011-01-27 17:02:34