Results 1 to 9 of 9

Thread: include_path PEAR problem **PLEASE HELP**

  1. #1
    anonymous500r NNTP User

    Default include_path PEAR problem **PLEASE HELP**

    OK. I've been spending the last 1 1/2 hours looking for a solution to this. I'm running a development server on my OpenSUSE 11.0 box and installed Apache2, PHP-5.2.9, MySQL and PEAR all using YAST, but no matter what I do I cannot include the installed PEAR packages in my PHP scripts. I figured out that the include_path configuration variable is being set to '.:' despite the loaded php.ini file setting this variable as include_path = ".:/usr/share/php5:/usr/share/php5/PEAR"

    It does not matter how I change the include_path variable and it does not matter if I remove the .: part. I've restarted apache2 many times and I still get the error message. It suggests to me that the path is being changed at some point but what could be changing it? Any ideas appreciated because this is a really frustrating problem :#

    OH yes, and one of my error messages for good measure:

    Fatal error: require_once() [function.require]: Failed opening required 'File/Archive.php' (include_path='.:') in /srv/www/htdocs/pitchfork/actions/pitchfork-action-file-decompress.php on line 16

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: include_path PEAR problem **PLEASE HELP**

    There are a couple of places the include path can be set, one is php.ini (but be sure to get the right one, there's one for apache2 and one for the cli PHP), and another is inside the Apache configuration for the app or the vhost configuration containing that app. Look for a line like this:

    Code:
    php_admin_value include_path ...
    in the config file of the app somewhere in /etc/apache2/conf.d/ or perhaps /etc/apache2/vhosts.d/

  3. #3
    anonymous500r NNTP User

    Default Re: include_path PEAR problem **PLEASE HELP**

    @ ken_yap Wow! I didn't expect an answer within minutes! Thanks for the advice but sadly I can't find a file with that particular snippet within. Any other ways to override the include_path

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: include_path PEAR problem **PLEASE HELP**

    Yes, the app itself can override the settings, so you would have to examine the PHP code. Presumably it should provide you with a way of configuring it. Look for a call like this in the PHP code:

    Code:
    ini_set("include_path", ...

  5. #5
    anonymous500r NNTP User

    Default Re: include_path PEAR problem **PLEASE HELP**

    No, I've tried files outside the application. They all point to the incorrect include path.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: include_path PEAR problem **PLEASE HELP**

    Put this short page on your server, what does it show for the include_path?

    Code:
    <?php
      phpinfo();
    ?>
    Do any of the .ini files displayed as having been read change the include_path?

  7. #7
    anonymous500r NNTP User

    Default Re: include_path PEAR problem **PLEASE HELP**

    OK. I resolved the issue. It appears I accidentally asked PHP to report one set of errors on one line of php.ini and and another set on another line. This caused a parsing error which meant that most of the file was ignored. It would have been good if Apache had told me that when it restarted each time.

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: include_path PEAR problem **PLEASE HELP**

    Maybe it did. Did you look in /var/log/apache2/error_log?

  9. #9
    anonymous500r NNTP User

    Default Re: include_path PEAR problem **PLEASE HELP**

    Yep. I tailed error_log an it told me there was a parse error. After fixing the file, the include_path was then as it should have been. Thanks for the help!

Tags for this Thread

Posting Permissions

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