For the more-programming inclined.
The rest of you, you’ve been warned.
So I’m trying to implement this google response page using the Google SOAP API for this new teacher’s conference for the state of Illinois. The search needs to be able to search through two different databases (programs and resources) and the site itself. The reason I’m trying to do this in the deprecated fashion and not the new AJAX method is that a) we need the customization and b) we need the accessibility.
Lots of things have been going wrong, and I’m here to share with you the pains of my world this week.
First mistake was that I didn’t know the PHP Apache Module for Mac OS X that Marc Liyanage puts up doesn’t come with “display_errors = On” as default (Step by step way to turn it on here). It kind of makes sense, but since I haven’t really done PHP programming while using my own laptop as the dev box, I didn’t know of the existence of this issue. It also doesn’t help that my live box is also a Mac OS X, and I was completely confused when I didn’t get a single error when I started typing random characters into the .php file.
Heck, I started to doubt the validity of the “include” and “require” functions… and found out over and over that it works, just not for this soap class file I was trying to include. When I found out that there was indeed an error in executing the SOAP call after enabling display_errors, I was met with this lovely error:
“Fatal error: Cannot redeclare class soapclient in /Users/jk/Sites/google/nusoap/nusoap.php on line 7240″
You’ve got to be kidding me. After a quick google search, I find that NuSOAP is having issue with PHP 5:
There seems to be a clash of PHP5 build-in soap class and the nusoap class. Simply rename all occurences of “soapclient” in all 10 nusoap files into “soapclientw” (or whatever instead of “w”) and for me it worked.
YES. Now it should work right?
NO.
Yet another error, this time was something completely different. It looked like it was looking for a WSDL file (looking for the
So at this point, I decide to go another route. Instead of using NuSOAP, let’s go ahead and install the PEAR module for SOAP. Of course, I have to update PEAR itself, because it was out of date. Dependencies… install one, update the other… okay, installed. Nothing. Nothing happened again.
Then I decided to restart the apache server.
> apachectl restart
Thank goodness I didn’t type sudo in front of that… or I would have an angry mob of college students outside of my office. Whew. But crisis averted… thank goodness.
I have a question for those that know: would restarting after installing the PEAR module do anything? Isn’t it running as a separate process apart from apache? I don’t know… but I guess I have all of tonight to figure this out.
Oh boy, not another all-nighter… Please not another one…
I did a project involving SOAP recently and I used PHP5’s built-in SOAP support which is very nice. Is there a reason you try to use external SOAP libraries instead of what comes included in the PHP core?
One reason I use external PHP libraries is to make it compatible with PHP 4 and 5. That’s the only one otherwise of course it’s better to use built in support than to load almost 7400 lines of nusoap.php