How To Install SOAP for PHP on a 1&1 VPS

July 30th, 2015 - Posted by Steve Marks to PHP, Server Management, Web Development.

If working with a third party service it’s possible that you might need to communicate with it using SOAP. This is exactly the scenario we found ourselves in today. The issue was however that the 1&1 VPS that the site was hosted on didn’t have SOAP, and inparticular SOAPClient, enabled.

Normally I’d steer away from trying to do anything sysadmin-ey, especially if we’re talking about working with a live server. Seeing as I didn’t have an alternative server available though I simply took the plunge and accepted the challenge.

Below you will find the exact steps I took:

1. Log into the SSH command line
You’ll want to get onto the server’s command line using a program such as Putty Download. The login details for the server can be found within the 1&1 control panel under ‘Server Administration > Server Access Data‘.

1and1 Server Access Data

2. Check whether SOAP is already installed
You can do a quick check to make sure SOAP isn’t already installed by running the following command:

php -i | grep -i soap

This will scan the php.ini file for occurences of the word ‘soap’ and return any results that it finds. If it is installed you’ll see something like the below:

PHP.ini with SOAP installed

If you don’t see the above, it’s safe to assume that you need to go through with the installation.

3. Install php-soap
SOAP for PHP can be installed through use of one simple command as follows:

sudo yum install php-soap

You’ll see the files download and it will ask if you want to continue. Type ‘y’ and hit enter at this point.

4. Check it’s installed
At this point, if you run the following command again…

php -i | grep -i soap

… you should now see that ‘soap’ related results get found in the php.ini file.

Note: For me there was no need to restart anything. It simply started working immediately.

You should now be able to use classes such as SoapClient to assist with your integrations.

Tags: , , ,
This entry was posted on Thursday, July 30th, 2015 at 6:36 pm by +Steve Marks and is filed under PHP, Server Management, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.
Comments...

Fear not, we won't publish this

Comments (1)
  1. adil says:

    ca marche, milles merci