Dav*_*hen 27 php mamp oauth pecl
我是设置php服务器的新手,我曾经去过其他相关帖子,似乎没有人像我一样有错误.我正在使用MAMP 2.0.2,并运行PHP 5.3.6,我试图使用以下命令在我的本地MAMP上安装oAuth:
$ cd /Applications/MAMP/bin/php/php5.3.6/bin
$ ./pecl install oauth
Run Code Online (Sandbox Code Playgroud)
但是,它会返回这样的错误:
Notice: unserialize(): Error at offset 276 of 1133 bytes in Config.php on line 1050
ERROR: The default config file is not a valid config file or is corrupted.
Run Code Online (Sandbox Code Playgroud)
怎么了?PECL捆绑在MAMP中,应该开箱即用....
更新:
我在其他地方读了一篇帖子,建议配置文件的数据,它保存安装路径是不正确的,所以我在以下文件中更改了一些值:
/Applications/MAMP/bin/php/php5.3.6/conf/pear.conf
Run Code Online (Sandbox Code Playgroud)
然后,我使用命令:
$ ./pecl install oauth
Run Code Online (Sandbox Code Playgroud)
它开始下载和解压缩,但当它尝试安装时,它给出:
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-user1RU5EZA/oauth-1.2.2/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-user1RU5EZA/oauth-1.2.2/include -I/private/tmp/pear/temp/pear-build-user1RU5EZA/oauth-1.2.2/main -I/private/tmp/pear/temp/oauth -I/Applications/MAMP/bin/php/php5.3.6/include/php -I/Applications/MAMP/bin/php/php5.3.6/include/php/main -I/Applications/MAMP/bin/php/php5.3.6/include/php/TSRM -I/Applications/MAMP/bin/php/php5.3.6/include/php/Zend -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /private/tmp/pear/temp/oauth/oauth.c -o oauth.lo
mkdir .libs
cc -I. -I/private/tmp/pear/temp/oauth -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-user1RU5EZA/oauth-1.2.2/include -I/private/tmp/pear/temp/pear-build-user1RU5EZA/oauth-1.2.2/main -I/private/tmp/pear/temp/oauth -I/Applications/MAMP/bin/php/php5.3.6/include/php -I/Applications/MAMP/bin/php/php5.3.6/include/php/main -I/Applications/MAMP/bin/php/php5.3.6/include/php/TSRM -I/Applications/MAMP/bin/php/php5.3.6/include/php/Zend -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext -I/Applications/MAMP/bin/php/php5.3.6/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -g -c /private/tmp/pear/temp/oauth/oauth.c -fno-common -DPIC -o .libs/oauth.o
In file included from /private/tmp/pear/temp/oauth/oauth.c:14:
/private/tmp/pear/temp/oauth/php_oauth.h:20:10:
fatal error: 'php.h' file not found
include "php.h"
^
1 error generated.
make: *** [oauth.lo] Error 1
ERROR: `make' failed
Run Code Online (Sandbox Code Playgroud)
再一次,发生了什么?
Ste*_*hen 65
我知道这已经过时了但是在遇到类似问题时我发现了这个问题.
MAMP没有附带一堆PHP源代码
为PHP源创建目录:
mkdir -vp /Applications/MAMP/bin/php5/include
解压php-5.xxtar.gz到/Applications/MAMP/bin/php/php5.*/include或/ Applications/MAMP/bin/php5/include:
tar zxvf php-5.x.x.tar.gz -C /Applications/MAMP/bin/php/php5.?.??/include
将您的php-5.xx目录重命名为php(没有版本编号):
mv /Applications/MAMP/bin/php/php5.2.17/include/php-5.?.?? /Applications/
MAMP/bin/php/php5.2.17/include/php
配置PHP源(它将创建必要的文件,即zend_config.h,tsrm_config.h等):
cd /Applications/MAMP/bin/php/php5.?.??/include/php
./configure
该过程是另一个修复,但这解决了找不到php.h的问题
相信我找到答案的地方 - :
小智 29
在尝试pecl install -f ssh2
使用MAMP 时我遇到了同样的问题.
以下是我修复它的方法:
./configure
以配置平台的源代码(如果没有此步骤,pecl安装将无法查找一堆头文件)pecl
安装(非常感谢斯蒂芬的答案,这几乎是一样的)
小智 6
这是斯蒂芬答案和格雷格评论的补充
在OSX 10.10.2上为php 5.6.2编译xdebug 2.3.2时,我无法摆脱它
找不到'zend_config.h'文件
错误,直到我在php文件夹中添加以下选项到./configure:
./configure --without-iconv
归档时间: |
|
查看次数: |
27796 次 |
最近记录: |