4579 Posts in 1388 Topics by 1378 members
| Go to End | Next > | |
| Author | Topic: | 4759 Views |
-
Re: Include Path Problem

23 November 2010 at 12:57am
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
-
Re: Include Path Problem

23 November 2010 at 9:29am Last edited: 23 November 2010 9:31am
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 -
Re: Include Path Problem

23 November 2010 at 10:36am
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" -
Re: Include Path Problem

23 November 2010 at 10:39am Last edited: 23 November 2010 10:43am
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
-
Re: Include Path Problem

23 November 2010 at 10:47am Last edited: 23 November 2010 10:48am
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
-
Re: Include Path Problem

23 November 2010 at 10:50am
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?
-
Re: Include Path Problem

23 November 2010 at 10:56am Last edited: 23 November 2010 10:56am
Should be fine to go anywhere in .htaccess. I usually put php settings at the bottom to keep it tidy.
-
Re: Include Path Problem

23 November 2010 at 11:00am
You may also need to put quotes around the value, like this:
php_value include_path "/my/path"
| 4759 Views | ||
| Go to Top | Next > |


