SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PEAR SOAP Installed or not ?

    HI friends,

    when i tried to execute my PHP script for a soap request, it gave me the following error.
    ----------------------------------------------------------------
    Fatal error: main(): Failed opening required 'SOAP/Client.php' (include_path='.;c:\php\pear')
    ------------------------------------------------------------------
    Since i'm in testing phase & thought of checking it, i just wrote a single line in the PHP script of mine
    -----------------------------------------------------
    <?php
    require_once('SOAP/Client.php' );
    ?>
    ------------------------------------------------------
    I have two questions:

    1. Is it because PEAR SOAP is not installed in my server.?
    2. How can i know whether it is installed or not?

    if somebody can give me a test script by which i can test this pear package, it will be nice.

    thanks,
    pb

  2. #2
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't want to mess around with your hosts configuration, just copy your local PEAR folder to your home directory on the server and change the include path at the top of your script. Like so --

    Code:
    ini_set('include_path', '/home/mysite/PEAR'.PATH_SEPARATOR.ini_get('include_path'));
    Assuming the script is working on your local setup, that should do the trick.

    Best wishes,
    Denny

  3. #3
    SitePoint Member
    Join Date
    May 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the response...
    can you tell me what is the use of "PATH_SEPARATOR.ini_get()".
    One morething: how can i know whether PEAR SOAP is installed or not?
    Since i running in remote server(ISP), i don't have access to those files also to copy it..but let me try it...

  4. #4
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PATH_SEPARATOR is a constant that varies according to the OS PHP is installed on. On Windows it's a semicolon. On Linux it's a colon. So this is for portability, basically.

    ini_get('include_path') returns the current include_path, which can be set in php.ini, .htaccess, or by a PHP script using ini_set().

    The whole line is basically putting a custom include path at the front of the search path. This way include_once() calls will search this directory first, so it will find the files faster than if we had put it on the back end. E.g., --

    Code:
    // Potentially slower than the suggested approach
    ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'/home/mysite/PEAR');
    If you can put files on your hosting account (which you should be able to do), you can put whatever PEAR libraries you want up there with this method.

    Good luck!
    Denny


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •