Jump to:

4952 Posts in 14106 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Include Path Problem

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 5905 Views
  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Include Path Problem Link to this post

    Hey Guys.

    I copied over the new Core.php file in the changeset and tried to install. Still getting the same error unfortunately.

    Warning: require_once(Zend/Log.php) [function.require-once]: failed to open stream: No such file or directory in /home/issl/public_html/sapphire/dev/Log.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Log.php' (include_path='/usr/lib/php:/usr/local/lib/php:/usr/local/cpanel/3rdparty/lib/php:/tmp:/home:.:/home/issl/php') in /home/issl/public_html/sapphire/dev/Log.php on line 2

    Just wondering. Could it be because my clients address has a dash in the domain name? The actual address is http://iss-l.com/ and i'm noticing above that the path is showing ass /home/issl/php

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Include Path Problem Link to this post

    MagicUK: I think there's something on the host that won't allow you to use set_include_path()

    So you've applied the fix from here? http://open.silverstripe.org/changeset/113976

    Try this... look for the set_include_path() code in Core.php and put some debugging code in like this:

    var_dump('before: ' . get_include_path());

    set_include_path(BASE_PATH . '/sapphire' . PATH_SEPARATOR
       . BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
       . BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
       . get_include_path());

    var_dump('after: ' . get_include_path());
    die();

    Could you tell me what the before and after strings show on the screen as after visiting your site with the above code in place?

    Mine shows like this:

    string 'before: .:/opt/local/lib/php' (length=28)
    string 'after: /Users/sharvey/Sites/2.4/sapphire:/Users/sharvey/Sites/2.4/sapphire/parsers:/Users/sharvey/Sites/2.4/sapphire/thirdparty:.:/opt/local/lib/php' (length=148)

    If the sapphire paths do not appear in "after" for you, then it is possible the host has disabled the ability to modify the PHP include path.

    Cheers,
    Sean

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Include Path Problem Link to this post

    Thanks for the reply Sean. I did as you said and got the following:

    "before: /usr/lib/php:/usr/local/lib/php:/usr/local/cpanel/3rdparty/lib/php:/tmp:/home:.:/home/issl/php" string(101)
    "after: /usr/lib/php:/usr/local/lib/php:/usr/local/cpanel/3rdparty/lib/php:/tmp:/home:.:/home/issl/php"

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Include Path Problem Link to this post

    My suspicions appear to be correct... your host does not allow you to change the include path, at least not using set_include_path() function in PHP.

    Perhaps you could ask them if it's possible another way to add your own paths?

    Using .htaccess, something like this:

    php_value include_path .:/my/path/here

    It's not as good, because it completely overrides the old paths instead of prefixing the new ones to the start.

    Sean

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Include Path Problem Link to this post

    To add the .htaccess value, you'll need to take the output of this from PHP (you can just do the following in Core.php and copy the contents that appear on screen):

    var_dump(BASE_PATH . '/sapphire' . PATH_SEPARATOR
       . BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
       . BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
       . get_include_path());

    And then place it into the .htaccess file like this:

    php_value include_path /home/mysite/sapphire:/home/mysite/sapphire/parsers:/home/mysite/sapphire/thirdparty:/home/mysite/sapphire:/home/mysite/sapphire/parsers:/home/mysite/sapphire/thirdparty:.:/opt/local/lib/php

    Make sure it's all on one line.

    Hope that helps!

    Sean

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Include Path Problem Link to this post

    Great. Thanks Sean. I'll give that a go. I take it I can add it to anywhere in the .htaccess file? Just append it to the end?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Include Path Problem Link to this post

    Should be fine to go anywhere in .htaccess. I usually put php settings at the bottom to keep it tidy.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Include Path Problem Link to this post

    You may also need to put quotes around the value, like this:

    php_value include_path "/my/path"

    5905 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.