FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Server Configuration Problem





Aredon
Code:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required '/usr/local/lib/php/httpcache-class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0


So my client recently moved the site I was working on to a new server. He asked me if I knew what this error meant and I can honestly say I have never had to deal with most of the server-side configuration. It is my hunch that the path to php is missing, but I honestly couldn't say. Anyway, this error shows up for .php pages only. .html pages load fine, anything .php will fail immediately.


It would be great if I could get this fixed for him as he seems to be having trouble finding someone who knows what's going on. Any ideas frihosters? Wink
Asap170
Because html doesn't call files. Php calls files.

The problem is that the server doesn't have that file and when it's looking for it and can't find it it will display that error message. Give the new host a call and see if they are supposed to have that file on the server or if it's a coding mistake.
Aredon
I believe that was my assumption as well, you're saying that the path to '/usr/local/lib/php/httpcache-class.php' is invalid or doesn't exist right? Furthermore I don't think it can be a code mistake since it's at line 0, (and blank php files have the same error).
jmraker
A google search for httpcache.class.php found
http://code.google.com/p/moriarty/source/browse/trunk/httpcache.class.php?r=297

If it's being moved to a brand new server I doubt that php was installed with a missing file so the reference to that class must be somewhere from the old server.

My guess would be the file is in the .htaccess or php.ini file as a prepend include in the document root folder, the same directory that would have the index.php in http://server.com/index.php
or possibly in the main php.ini file.

If you are able to create the file, doing so would probably fix it until the class is used.
Aredon
jmraker wrote:

If it's being moved to a brand new server I doubt that php was installed with a missing file so the reference to that class must be somewhere from the old server.

I agree since his other php-based sites are working fine.
Quote:

If you are able to create the file, doing so would probably fix it until the class is used.

Come again? Able to create the file that's missing?
Fire Boar
Is the website using some kind of well-established system, such as phpBB, Drupal or Symfony? And is there a "cache" directory or similar (and if so, have you tried emptying it)?
Aredon
Fire Boar wrote:
Is the website using some kind of well-established system, such as phpBB, Drupal or Symfony? And is there a "cache" directory or similar (and if so, have you tried emptying it)?
phpBB, but as I said, the error occurs with brand new php files that have nothing in them. I will try emptying the cache, but I really doubt that will have any effect.
jmraker
Aredon wrote:
jmraker wrote:

If it's being moved to a brand new server I doubt that php was installed with a missing file so the reference to that class must be somewhere from the old server.

I agree since his other php-based sites are working fine.
Quote:

If you are able to create the file, doing so would probably fix it until the class is used.

Come again? Able to create the file that's missing?


If you're able to create /usr/local/lib/php/httpcache-class.php php as a blank file php should stop complaining about it not existing. If php is trying to use usr/local/lib/php/httpcache-class.php on
a page that's just <?php ?> then it could be a "auto prepend include" (like a header file) setting in the .htaccess with this setting like
Code:
php_value auto_prepend_file "/usr/local/lib/php/httpcache-class.php"

There could also be a corresponding auto_append_file setting
http://www.electrictoolbox.com/php-automatically-append-prepend/

or a php.ini (php can use php.ini in the document_root when suexec is being used) can be usedwith a line like
Code:
auto_prepend_file "/usr/local/lib/php/httpcache-class.php"

http://php.net/manual/en/ini.core.php
http://blog.philipbrown.id.au/2009/08/php-suexec-and-custom-php-ini-files/

Is there any reference to to httpcache-class.php in either file?
Aredon
Quote:

#zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension=/usr/local/Zend/lib/Optimizer-3.3.9/php-5.2.x/ZendOptimizer.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so


extension=ixed.5.2ts.lin
extension=uploadprogress.so
auto_prepend_file=/usr/local/lib/php/httpcache-class.php


Finally got into the php.ini file, looks like that last line is the trouble. What should I do here? Remove it?

Edit: Commenting that line out just gives me a blank page for all php pages now. Checked error reporting its set to E_ALL. So I'm at a loss as to why the page is blank. Should I just post the whole php.ini file for someone to look at? This really isn't my forte, I'm way out of my comfort zone on this one.
jmraker
PHP is probably hiding an error message and putting them in an error log somewhere, either in a file on the site or in the /var/log/ directory. It depends on the error_log setting in php.ini

http://php.net/manual/en/errorfunc.configuration.php

If you can't find the error log you can make them appear on the screen

Try setting or changing (copy and comment out the original line so you can change it back if it's already set)
Code:
error_reporting=E_ALL
display_errors=true
display_startup_errors=true


There's a good chance you'll see various warnings with E_ALL that are usually ignored and at the very end some info about the fatal error. It's best to view the page source if you can't see it.

Once it's fixed you can restore the error settings you changed in php.ini

You might be able to fix it by getting a copy of that file, putting it on the site and changing the prepend to the file if you know the full path to the file.
Related topics
Auto redirect your visitors to a different page
Interview: Derek Liu, Gaia Online Anime Community
Anyone knows mail server Configuration ?? Postfix / Sendmai
PHP index page not displaying problem
Boot up Windows XP 60 times faster
Server time
Ubuntu Linux blank screen on startup
everybody has server 2 problem? [solved]
Domain issue!!!!1
PHP question, $_SESSION[] gets changes to by $_POST var
Current server status
Internal Server Error
Problem with url redirecting
Too many re-directs problem?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.