Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP xmlrpc extension and MAMP

Tags:

php

mamp

moodle

I am trying to get the xmlrpc extension to work for php5 in MAMP (1.8.4).

I checked what version of PHP 5 was installed:

$ /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:

$ LIBS=-lresolv ./configure --prefix=/opt --with-xmlrpc=shared
$ make
$ ls modules
xmlrpc.a    xmlrpc.la   xmlrpc.so

I copied these files into MAMP:

$ cp modules/* /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/

I added the extension setting to the ini file:

$ vi /Applications/MAMP/conf/php5/php.ini
  extension=xmlrpc.so

I restarted 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:

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.

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.

Thanks.

UPDATE: I found the PHP log file and it has the following entry:

[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
like image 212
John Keyes Avatar asked Jan 08 '10 23:01

John Keyes


People also ask

How do I enable PHP extensions in Mamp?

Open MAMP PRO and click on the “PHP” entry in the sidebar in the “Languages” area. Activate the “Activate command line shortcuts for the selected PHP version, pear & pecl” checkbox. Restart your servers.

What is Xmlrpc extension?

XMLRPC is an extension that was bundled in PHP that brought XML RPC server and client features to PHP. This extension was relatively unused, and was marked "experimental" all along. This extension relied on some of the libraries that were not maintained for several years. xmlrpc extension is unbundled in PHP 8.0.


1 Answers

This way worked for me:

  • Downloaded Moodle4Mac (Moodle is a software that needs PHP and xmlrpc, and it comes with a built-in XAMPP);
  • Copied xmlrpc.so from that package (mine was under /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/);
  • Added extension=xmlrpc.so to PHP.INI.

Restarted MAMP and that was it. Hope it helps! :-)

like image 108
chesterbr Avatar answered Sep 30 '22 18:09

chesterbr