gre*_*fox 47 php xdebug osx-mavericks
安装OS X 10.9 Mavericks后,我在OS X上设置PHP开发环境时遇到问题.
这是我用来安装的命令.
sudo pecl install xdebug
downloading xdebug-2.2.3.tgz ...
Starting to download xdebug-2.2.3.tgz (250,543 bytes)
.....................................................done: 250,543 bytes
66 source files, building
running: 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.
ERROR: `phpize' failed
Run Code Online (Sandbox Code Playgroud)
任何人都有解决方案或解决方法?
Cre*_*rge 91
快速复制粘贴方式
sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "xdebug.so") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'
Run Code Online (Sandbox Code Playgroud)
此命令执行以下操作:
与Sierra,El Capitan和Yosemite兼容,带有Bunleled apache,但未经MAMP和XAMPP测试.
在启动命令之前,请确保已安装Xcode命令行工具: xcode-select --install
Dmi*_*sky 36
不知道使用pecl
.在OS X安装之后获取Xdebug非常简单pecl
.你有两个简单的选择:
使用以下版本:
/usr/lib/php/extensions/no-debug-non-zts-2010052/xdebug.so
Run Code Online (Sandbox Code Playgroud)建立你自己的:
确保您拥有Xcode CLI工具:xcode-select --install
将提示您安装CLI工具.安装CLI工具后,应该有内容/usr/include/php
.
转到http://xdebug.org/download.php并下载您想要的Xdebug版本的源代码tarball.例如:http://xdebug.org/files/xdebug-2.2.3.tgz.
将tarball解压缩cd
到它创建的目录中.在该目录中,您将看到一个README
.从这里开始:
$ phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
$ ./configure --enable-xdebug
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
[... output ...]
$ make
[... output ...]
Run Code Online (Sandbox Code Playgroud)你的建筑xdebug.so
现在在modules/xdebug.so
.该phpize
是一台安装了XCode CLI工具做关键的,因为phpize
设置为你的PHP版本的编译参数.
在xdebug.so
上面的(1)或(2)中,您可以将此块添加到php.ini
您php
或php-fpm
以下所使用的块中:
[Xdebug]
zend_extension=<full_path_to_xdebug.so>
xdebug.remote_enable=1
xdebug.remote_host=<host running PHP (e.g. localhost)>
xdebug.remote_port=<port Xdebug tries to connect to on the host running PHP (default 9000)>
Run Code Online (Sandbox Code Playgroud)
wal*_*5hy 16
这里有两个问题.首先,您需要使用以下命令安装Xcode命令行工具:
xcode-select --install
Run Code Online (Sandbox Code Playgroud)
这意味着以前找不到的文件/usr/include/php/
将可用.
下一步是autoconf
按照Ares在答案中显示的相同方式安装.
我会先cd
进入你的下载文件夹
cd ~/Downloads/
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xzf autoconf-latest.tar.gz
cd autoconf-*
./configure --prefix=/usr/local
make
sudo make install
Run Code Online (Sandbox Code Playgroud)
现在你可以运行pecl install
命令了
sudo pecl install xdebug
Run Code Online (Sandbox Code Playgroud)
oab*_*rca 16
如果您使用的是Mac Yosemite 10.10,则上述答案均未解决问题.请执行下列操作:
打开一个终端
执行find /usr/lib/php/extensions -name "xdebug.so"
以了解调试库的路径.
sudo nano /etc/php.ini
以打开并编辑php.ini文件在php.ini中,最后添加以下行
[XDebug]
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
Run Code Online (Sandbox Code Playgroud)(完成后,键入control+o
以保存并control+x
关闭文件)
(不要忘记在第一个终端命令中获取的内容中替换zend_extension中的值)
sudo apachectl restart
以加载新配置 归档时间: |
|
查看次数: |
55031 次 |
最近记录: |