[英]PHP xmlrpc extension and MAMP
I am trying to get the xmlrpc extension to work for php5 in MAMP (1.8.4). 我试图让xmlrpc扩展适用于MAMP(1.8.4)中的php5。
I checked what version of PHP 5 was installed: 我检查了安装了什么版本的PHP 5:
$ /Applications/MAMP/bin/php5/bin/php -v
PHP 5.2.11 (cli) (built: Dec 12 2009 13:19:08)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
I downloaded the PHP 5.2.11 source bundles, and built a shared library for xmlrpc: 我下载了PHP 5.2.11源代码包,并为xmlrpc构建了一个共享库:
$ LIBS=-lresolv ./configure --prefix=/opt --with-xmlrpc=shared
$ make
$ ls modules
xmlrpc.a xmlrpc.la xmlrpc.so
I copied these files into MAMP: 我将这些文件复制到MAMP中:
$ cp modules/* /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/
I added the extension setting to the ini file: 我将扩展设置添加到ini文件中:
$ vi /Applications/MAMP/conf/php5/php.ini
extension=xmlrpc.so
I restarted MAMP: 我重启了MAMP:
$ ./bin/stop.sh
$ ./bin/start.sh
When I do a phpinfo
the only reference to xmlrpc
I find is in the PHP Core section: 当我执行
phpinfo
,我发现的唯一对xmlrpc
引用是在PHP Core部分中:
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
I am trying to install Moodle and it still tells me that the xmlrpc extension is not available. 我正在尝试安装Moodle,它仍然告诉我xmlrpc扩展名不可用。
I'm a PHP novice, so if someone could tell me how to confirm the extension is available or not that would be great, or at least some pointers on how to debug this further. 我是一个PHP新手,所以如果有人可以告诉我如何确认扩展是否可用,那将是非常好的,或者至少有一些关于如何进一步调试的指针。
Thanks. 谢谢。
UPDATE : I found the PHP log file and it has the following entry: 更新 :我找到了PHP日志文件,它有以下条目:
[08-Jan-2010 23:37:52] PHP Warning: PHP Startup: Unable to load dynamic \
library '/Applications/MAMP/bin/php5/lib/php/extensions/ \
no-debug-non-zts- 20060613/xmlrpc.so' - (null) in Unknown on line 0
This way worked for me: 这种方式对我有用:
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626
) to MAMP's PHP extension folder (mine is /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
); /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626
)复制xmlrpc.so到MAMP的PHP扩展文件夹(我的是/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
); extension=xmlrpc.so
to PHP.INI
. extension=xmlrpc.so
添加到PHP.INI
。 Restarted MAMP and that was it. 重启MAMP,就是这样。 Hope it helps!
希望能帮助到你! :-)
:-)
Are you using the MAMP bundle package from moodle website? 您是否正在使用moodle网站的MAMP捆绑包? http://download.moodle.org/download.php/macosx/Moodle4Mac-XAMPP-20.dmg This one should work.
http://download.moodle.org/download.php/macosx/Moodle4Mac-XAMPP-20.dmg这个应该可行。
The reason PHP failed to load extension may cause by architecture type, PHP and its extension must use the same architecture type parameter in CFLAG. PHP无法加载扩展的原因可能是由于体系结构类型,PHP及其扩展必须在CFLAG中使用相同的体系结构类型参数。
I was having similar problem, but I wasn't using MAMP, I compiled PHP using static linking, sometimes, Mac OS X has weired problem to load dynamic library. 我有类似的问题,但我没有使用MAMP,我使用静态链接编译PHP,有时,Mac OS X已经遇到了加载动态库的问题。
Just be sure to move the xmlrpc.so file to the location /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/ (PHP version could be also 5.4 or 5.5) Then restart MAMP Then in your moodle install just click continue, it will still say that you should check the installation just continue. 只需确保将xmlrpc.so文件移动到/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/(PHP版本也可以是5.4或5.5)然后重新启动MAMP然后在你的moodle安装中点击继续,它仍然会说你应该继续检查安装。 It will start installing and will finish installing all modules and components, when all installed press Command F (MAC) or Control F (Win) and search for xmlrpc.so You will see that is succeed, so don't worry, it will work.
它将开始安装并将完成所有模块和组件的安装,当所有安装时按下命令F(MAC)或控制F(Win)并搜索xmlrpc.so您将看到成功,所以不用担心,它会工作。
Run the following commands from terminal 从终端运行以下命令
./configure 。/配置
make 使
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.