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

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

I restarted MAMP:

$ ./bin/
$ ./bin/

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.


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/' - (null) in Unknown on line 0


Are you using the MAMP bundle package from moodle website? This one should work.

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.

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.

Just be sure to move the 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. 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 You will see that is succeed, so don't worry, it will work.

  1. Download MAMP components from sourceforge
  2. Extract the zip file
  3. Inside the extracted folder you will see several php archives. Extract the one corresponding to your installed version. (In my case, my installed version was 5.5.9, but the highest version available from mamp components was 5.4.4 so I used that since I was going to build the source myself anyway).
  4. From terminal cd into the ext folder of the php folder you extracted and then cd into the xmlrpc folder.
  5. Run the following commands from terminal



  6. If successful, copy from the builds folder to the extensions folder of your php installation.
  7. Add to php.ini
By : Omoloro

This video can help you solving your question :)
By: admin