thank_you
thank_you

Reputation: 11107

Permission Files Nescessity and Failed Open Stream

I just installed XAMPP on Ubuntu and came across this error on my website page...

Warning: require_once(core/init.php): failed to open stream: Permission denied in 

/opt/lampp/htdocs/lr/start.php on line 44

Fatal error: require_once(): Failed opening required 'core/init.php' (include_path='.:/opt

/lampp/lib/php') in /opt/lampp/htdocs/lr/start.php on line 44

So I then went across and ran several lines of code changing the permissions for /opt/lampp/htdocs and the php.ini file with this code

sudo chmod 777 filename

The problem is that I'm still receiving the error from php. So my questions is, what am I missing in terms of which files should be executable so that I can run my code.

Upvotes: 0

Views: 3732

Answers (1)

Brett
Brett

Reputation: 2823

I would check the following items to determine why require_once() is returnning a FATAL error:

  1. Verify that the file /opt/lampp/htdocs/lr/core/init.php exists.
  2. Verify the owner of the file. The file should be owned by the user that is running PHP.
  3. Verify that the user running PHP has read access to the file.

Upvotes: 1

Related Questions