Solved

PHP -- installing SOAP module

Posted on 2014-09-24
18
674 Views
Last Modified: 2014-10-10
Hi,
I'm trying to install the SOAP module on my PHP install (Ubuntu)
PHP 5.3.3 (cli) (built: Feb  2 2012 07:02:01)


I'm getting this error message:
Error: php53-common conflicts with php-common

I looked around and found several different solutions to solve it. The thing is, I'm not a php expert and I don't want to break anything that is already working. We are running various PHP scripts on this server and I'm concerned any majors changes in PHP could break some of those scripts.

I need to install SOAP to get an outside third party script to run.

So, my question: is there a way around this error without risking messing up my current php install? Or more plainly put - what is the safest way around this error.

Thanks,
Nacht
0
Comment
Question by:nachtmsk
  • 5
  • 4
  • 3
  • +3
18 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40341688
Are you sure it's not already installed? What does phpinfo tell you
0
 

Author Comment

by:nachtmsk
ID: 40341704
Thanks for the reply.
I tried to run a script that needed SOAP and got this error message

Fatal error: Class 'SoapClient' not found in /home/zensynch/zensync.php on line 87

BTW -- line 87 in that script is:
  $client = new SoapClient("http://www.zenfolio.com/api/1.2/zfapi.asmx?wsdl");



So, I assumed that it wasn't installed.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40341720
In php.ini look for the extension=php_soap.dll and uncomment it
There is also a directive block called [soap] - again check if they are uncommented.
0
 

Author Comment

by:nachtmsk
ID: 40341793
These are the only lines in my php.ini file that reference SOAP
[soap]
; Enables or disables WSDL caching feature.
; http://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1

; Sets the directory name where SOAP extension will put cache files.
; http://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400


Can I just add in the one you mention or is there more to it then that?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40341795
On Ubuntu Linux, the extension would be extension=php_soap.so.  Generally on Linux, you should install PHP extensions thru the Package Manager.  File locations in Linux vary more than they do on Windows so you should try to get the one that matches your distribution.  

Unfortunately, my Ubuntu 10.0.4 system says that Canonical (the maintainer for Ubuntu) does not provide updates for 'php-soap'.  That leaves you in a difficult position.  You may have to compile not just PHP SOAP but maybe even all of PHP to get that to work on your Ubuntu system.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40341800
Dave is right, I was checking my windows version of php.ini for the full name.
Are you trying to add it through Yum
0
 

Author Comment

by:nachtmsk
ID: 40341818
Yes, I tried to add it in through Yum. Not really even sure what Yum is honestly, I assumed it was the PHP  package manager?? I'm not really a PHP programmer.
If it's not a simple install, I'm not going to  mess with compiling all of Php.
Thanks for all of this info.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40341820
Did you check for extension=php_soap.so in php.ini

If not there then add and restart Apache, if you get an error starting Apache then remove that line and start Apache again.

I assume this is an unmanaged server
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40341837
We are running various PHP scripts on this server and I'm concerned any majors changes in PHP could break some of those scripts.
It's reasonable to be concerned.  PHP 5.3 is obsolete and there are many changes in PHP at the current levels.  You can find the current levels on the right side of the PHP home page: http://php.net/

This is a long shot, but I'll take it anyway.  Have you asked the publishers of the web service if they have a RESTful API?  Some of my colleagues believe that SOAP is the devil.  I don't go quite that far, but there are many obvious reasons why most web publishers have abandoned SOAP in favor of REST.  The internet is littered with the rotting husks of failed SOAP projects.  In contrast, I have never met anyone who could not immediately understand and use a REST API.  So if there is a RESTful alternative, don't walk - run away from the SOAP interface.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40341912
While PHP 5.3 is technically obsolete, upgrading to PHP 5.5 or 5.6 is not possible on many Linux distributions because they use somewhat customized versions.  Ubuntu has been back-porting many updates and security patches to PHP 5.3.  Typically, you have to 'upgrade' the entire server to get a newer version of PHP.  That would require re-installing all customizations for no actual benefit.  Which is why most hosting companies avoid doing that as long as possible.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40341913
SOAP isn't terrible if you are fortunate enough to be using a SOAP wrapper like WCF (.NET) or nuSOAP. Honestly, I'd suggest nuSOAP over PHP's built-in client every time.

Also, I would recommend looking into downloading and compiling PHP from source instead of using Yum to install. The Yum repos are notorious for getting out of date unless you try to add 3rd party repos. Getting PHP from source and getting the compiling and installing process streamlined will let you stay up to date with things and give you far more control over your PHP install. If you stay on the default Yum repos, you'll be stuck on 5.3 forever.

I love CentOS and I love yum, but I just don't use it for the essentials in a LAMP stack. Compile and run your own Apache, PHP, and MySQL if you can. It takes a little longer and you'll have to learn a little bit about how to do it, but it's usually worth it.
0
 

Author Comment

by:nachtmsk
ID: 40341924
Thanks everyone. This is one of several servers I manage. This particular one is functioning well and I don't want to throw a monkey into the mix. The script I'm trying to get running was written a  long time ago and I don't think it's been updated recently though I will check with it's dev.
It's purpose was to connect to a photo site called ZenFolio and automate a file/photo transfer directly from the linux box. If I had the time myself I'd write my own interface using the ZenFolio API but I don't have that luxury of time unfortunately.  I'll have to get the photos uploaded to ZenFolio in a less elegant manner.
Thanks!
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40341929
Also, building from source will allow you to often avoid the requirements debacle that Dave just mentioned. Pre-compiled packages are built against specific libraries, which is why it becomes a hassle for package managers. The package managers are a little stupid and they have to go and update those packages to specific versions just to get the PHP packages installed.

When you compile and install from source, you can usually just use most of the same libraries you already had installed. You don't have to follow the somewhat-dumb package manager rules.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40341943
Not to put too find a point on it, but if you're short on time SOAP is not likely to be your friend.  Check this alternative:
http://www.zenfolio.com/zf/help/api/examples/uploader
0
 

Author Comment

by:nachtmsk
ID: 40341945
Hey.. here's a question. Can I have two versions of PHP running on the same box in different places?
I've done that with Perl before.
If I install another version of PHP, can I completely isolate it from the  current working version or will some things overlap?
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40342280
Yes you can have more than one version of PHP installed, but your web server can only run one of those PHP versions at a time (there might be a way around this, but it would likely involve different file extensions and could possibly create more problems).
0
 
LVL 33

Expert Comment

by:Slick812
ID: 40344699
Not sure, maybe already said here, but some PHP installs do NOT have SOAP enabled, I seem to remember you need to add
 --enable-soap .
to the configurreation,   as  php.ini   I think.
You can have server virtual machines, and run most any setup (including PHP) on that VM,
But you may want to take a step back, and try and simplify, instead goin more complex.
Try and see if you have the   php_soap.so   linux  library on the PHP files, then you may only need to enable SOAP? ? ?
0
 
LVL 33

Expert Comment

by:Slick812
ID: 40344739
Sorry, I was wrong in the last comment, you may look at this -
https://stavrovski.net/blog/how-to-install-and-enable-php-soap-intl-and-xmlrpc-in-directadmin

which seems to have some needed info about SERVER setup for PHP 5.3

there are Forums for specific SERVER OS (redhat, centos, ubuntu) that can get advice from some server ACES, that may know alot of these things.

I gave up on managing servers, as it takes much experience and knowledge, that can cause BIG problems, if you do not know what you are doing. It really pays for me to let people with much experience manage my servers, as the hosting company usually.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now