I started trying to learn Magento’s API today, which requires the use of SOAP. I know that SOAP is a part of PHP5, however, I guess it doesn’t often come enabled on a lot of servers. I have a DV with Media Temple, and after running phpinfo(), I saw that SOAP definitely wasn’t configured.
The following instructions will guide you through adding the SOAP to your previous installation of PHP. In my case, I had PHP 5.2.6 installed, so – note that when you are downloading the PHP source files – you should probably try and stick with the version you currently have.
Install Media Temple’s Developer Tools
You will need the developer tools installed to compile PHP. So, login to your Media Temple account center, select your primary domain, find the “Root Access & Developer Tools”. Install the developer tools if you haven’t already. It may take up to 5-10 minutes, so be patient.
Make sure you have enabled root access as well, as you will need this to be able to compile the PHP
Download & Compile PHP
Open your terminal, and ssh into your server using root.
- Navigate to a relatively unimportant directory. I chose /home/
- Download PHP
- Unpack the PHP file
tar -zxf php-5.2.6.tar.gz
- Configure the new PHP to enable SOAP (will take a few minutes) (before enable is two dashes)
- Rebuild PHP (this will also take a while)
- Copy just the SOAP module into your existing installation of PHP
cp modules/soap.so /usr/lib/php/modules/
- Add the new SOAP configuration to your existing configuration
echo "extension=soap.so" > /etc/php.d/soap.ini
- Restart Apache
- Optional: You can now delete /home/php-5.2.6/ if you’d like, as you won’t need it any longer.
rm -rf /home/php-5.2.6/
- Check phpinfo() to confirm that SOAP is now enabled.
This should not effect Media Temple’s update option program, in the case where you would like to up update your server later on.
Special thanks to dotjay for initially pointing this all out.