johndoh Posted August 2, 2008 Share Posted August 2, 2008 Hi there, I can't always get my laptop connected to the internet and I installed LAMP on it (using Ubuntu Hardy) in order to work on a web site that I was previously working on using WAMP. I got the whole thing working perfectly (so far) except for one thing (that was never a problem on Windows) - with the internet not connected, any attempt to access my web site on localhost shows this error: Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/john/public_html/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line When the laptop is connected to the internet, the web site is displayed correctly. I just want to be able to work on my web site offline. public_html is my localhost folder. Can anybody help me with this? Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/117819-php-throws-up-error-message-when-i-access-localhost-with-internet-not-connected/ Share on other sites More sharing options...
Daniel0 Posted August 3, 2008 Share Posted August 3, 2008 Try to run: sudo chown -R john:www-data ~john/public_html chmod -R g+w ~john/public_html Quote Link to comment https://forums.phpfreaks.com/topic/117819-php-throws-up-error-message-when-i-access-localhost-with-internet-not-connected/#findComment-606789 Share on other sites More sharing options...
johndoh Posted August 3, 2008 Author Share Posted August 3, 2008 Hi there, Cheers for the response. I tried it out and now instead of getting the php error stated above, Firefox gives me the generic Offline Mode screen that I would get with any other web page. I seem to have gone back a step... Quote Link to comment https://forums.phpfreaks.com/topic/117819-php-throws-up-error-message-when-i-access-localhost-with-internet-not-connected/#findComment-606831 Share on other sites More sharing options...
Daniel0 Posted August 3, 2008 Share Posted August 3, 2008 In Firefox, click File and then uncheck "Work Offline". I don't even know why that feature is there, but when it's checked you cannot browse any pages. Or is that not the offline mode you are referring to? Quote Link to comment https://forums.phpfreaks.com/topic/117819-php-throws-up-error-message-when-i-access-localhost-with-internet-not-connected/#findComment-606836 Share on other sites More sharing options...
johndoh Posted August 3, 2008 Author Share Posted August 3, 2008 Yay, it works! Fantastic stuff, thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/117819-php-throws-up-error-message-when-i-access-localhost-with-internet-not-connected/#findComment-606860 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.