使用MAMP在Mac OSX上构建/安装XDebug

Dmi*_*lov 7 php mamp xdebug osx-lion

我在使用MAMP在Mac OSX上构建/安装XDebug时遇到问题.

到目前为止,我在网上进行了广泛的搜索,目前我被困在XDebug"安装向导"的一部分,它告诉我在我下载的源代码上"运行:phpize".

当我运行时,phpize我收到以下消息:

new-host-2:xdebug-2.2.0 Dima$ phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No:  
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
Run Code Online (Sandbox Code Playgroud)

如果我做了which phpize我得到:

new-host-2:xdebug-2.2.0 Dima$ which phpize
/usr/bin/phpize
Run Code Online (Sandbox Code Playgroud)

这不是我想要使用的版本,我想使用phpize我假设的MAMP安装版本,因为我想在MAMP版本的PHP上安装XDebug.这很令人费解,因为我已将MAMP特定的PHP bin路径添加到我的.bash_profile中$PATH.

如果我跑echo $PATH我得到:

new-host-2:xdebug-2.2.0 Dima$ echo $PATH
/opt/local/bin:/opt/local/sbin:/Applications/MAMP/bin/php/php5.4.3/bin:/Users/Dima/.rvm/gems/ruby-1.9.2-p290/bin:/Users/Dima/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/Dima/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/Dima/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Run Code Online (Sandbox Code Playgroud)

MAMP特定的PHP路径显示在'/ usr/bin'之前.我试过的下一件事是运行MAMP特定的phpize,手动提供整个路径,如下所示:

new-host-2:xdebug-2.2.0 Dima$ /Applications/MAMP/bin/php/php5.4.3/bin/phpize 
-bash: /Applications/MAMP/bin/php/php5.4.3/bin/phpize: Permission denied
Run Code Online (Sandbox Code Playgroud)

现在我在Finder中检查了这些文件的权限,它表明我有完全的权限来读取和写入这个文件夹的文件.我有点失落.任何帮助将非常感激.如果有助于诊断此问题,我可以发布任何其他信息.

小智 12

有同样的问题,但找到了更好的解决方案

xDebug已经在MAMP中.

检查你的php.ini

/Applications/MAMP/conf/php5.x/php.ini
Run Code Online (Sandbox Code Playgroud)

一路走下去.你会看见

[xdebug]
;zend_extension="/Applications/MAMP/bin/php5.X/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Run Code Online (Sandbox Code Playgroud)

改变成

[xdebug]
zend_extension="/Applications/MAMP/bin/php5.X/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
Run Code Online (Sandbox Code Playgroud)

重启服务器...完成!

http://danpolant.com/want-to-run-xdebug-mamp-is-the-easiest-way/


小智 8

我尝试了上面的内容,但我并没有为我工作,所以我用Google搜索了一些,这就是诀窍.

  1. 从SourceForge 下载并解压缩MAMP组件

  2. 记下在phpize过程中找不到的路径,对我来说是:

    /Applications/MAMP/bin/php/php5.2.17/include/php/main/php.h
    
    /Applications/MAMP/bin/php/php5.2.17/include/php/Zend/zend_modules.h
    
    /Applications/MAMP/bin/php/php5.2.17/include/php/Zend/zend_extensions.h
    
    Run Code Online (Sandbox Code Playgroud)
  3. 在你的MAMP php目录中创建所需的路径,对我来说也是如此

    /include/php/
    
    Run Code Online (Sandbox Code Playgroud)
  4. 确保目录的正确权限

  5. 找到目标PHP版本的组件(在我的例子中为5.2.17),并将它们复制到您在步骤3中创建的路径中.

  6. 运行从Xdebug站点使用正确版本的phpize的说明

我希望能帮助别人,因为我花了太长时间来解决这个问题!