Jump to content

Recommended Posts

Posted

OKAY,

 

I am usually quite versatile when it comes to making things work, but right now I'm stuck: How do I gain access to TCH's SOAP and PEAR files/directories?

 

Ultimately, I need to get the PayPal API to work on TCH, but right now, I'm just looking for an actual working example from someone who was able to get PEAR::SOAP to work at TCH.

 

S C E N A R I O :

My PHP include files are in a local directory, so I altered the include_path by way of .htaccess like so:

 

php_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/myaccount/public_html/ih/inc"

 

(That leaves the original TCH include path intact, right? And just adds mine to the list, right?)

 

Next, I create a test file (soap_01.php) like so:

 

<?php

 

// Load the PEAR::SOAP client class

require_once 'SOAP/Client.php';

 

// Read the GlobalWeather WSDL document

$wsdl = new SOAP_WSDL('http://live.capescience.com/wsdl/GlobalWeather.wsdl');

 

?>

 

And here's where I get all the problems and errors. Cannot find Client.php . . . and so forth. Once I had all the PEAR::SOAP files in my local include directory, but then I got errors asking for the base PEAR files.

 

Do I really have to upload all of the PEAR files myself? Or is there a global repository at TCH that I can access? And has anyone successfully gotten this to work in PHP?

 

Would anyone be able to share an example with me? Please?

 

Thanks much,

Dee

 

 

PS: I'm on Server14 if that helps.

 

Edit: TCH-Bruce - removed account info

Posted

Welcome to the forums Dee :thumbup1:

 

While I don't know the answer to your question but I wanted to welcome you to the forums.

 

I'm sure someone will be along to give you an answer.

Posted

Welcome to the forums, Dee! :thumbup1:

 

How do I gain access to TCH's SOAP and PEAR files/directories?

From what I can tell, the TCH servers would only have the base installation files for PEAR - no packages (libraries).

 

php_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/myaccount/public_html/ih/inc"

 

(That leaves the original TCH include path intact, right? And just adds mine to the list, right?)

Yes, but your include directory should come before the TCH server directories so any package you upload will take precedence if that same package happens to be installed on the server:

>php_value include_path ".:/home/myaccount/public_html/ih/inc:/usr/lib/php:/usr/local/lib/php"

 

And here's where I get all the problems and errors. Cannot find Client.php . . . and so forth. Once I had all the PEAR::SOAP files in my local include directory, but then I got errors asking for the base PEAR files.

 

Do I really have to upload all of the PEAR files myself? Or is there a global repository at TCH that I can access? And has anyone successfully gotten this to work in PHP?

You don't have to upload "all of the PEAR files", but you do need to upload any PEAR packages that are needed.

 

It sounds like you downloaded the SOAP package and installed it on your server in your include directory. When the SOAP-0.9.1.tgz file is unpacked, the files are extracted into a directory named 'soap-0.9.1'. This directory must be renamed to 'SOAP' in your include directory in order for your scripts to find the 'SOAP' package files (such as SOAP/Client.php).

 

The SOAP package also requires 3 additonal PEAR packages to be downloaded and installed:

HTTP_Request

Net_URL

Net_Socket

 

1) When the HTTP_Request package is unpacked, the files are extracted into a directory named "HTTP_Request-1.2.4". This directory must be renamed to 'HTTP' in your include directory in order for your script to find the 'HTTP' package files.

 

2) When the Net_URL package is unpacked, the files are extracted into a directory named "Net_URL-1.0.14". This directory must be renamed to 'Net' in your include directory in order for your script to find the 'Net' package files.

 

3) When the Net_Socket package is unpacked, there is one file that is extracted into a directory named "Net_Socket-1.0.6". You'll already have a directory named 'Net' from step 2 above, so you just need to move/upload the Socket.php file into the 'Net' directory in your include directory on the server.

 

If you installed your own PEAR package installer on your server account, and used it to download and install the above PEAR packages, the installer would automatically handle the directory renaming in the steps above for you.

 

Your include directory should end up with these subdirectories:

>/home/myaccount/public_html/ih/inc
                                 |--HTTP
                                 |--Net
                                 |--SOAP

 

Once you have the 4 PEAR libraries installed as I've described above, your soap_01.php test script works fine. It doesn't output anything (because there's no code that produces any output), but it doesn't generate any errors either.

 

Hope this helps...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...