Question

I'm using LAMP on my local machine. I'm getting the following error in apache error log and a blank web page in browser when I hit the URL:http://localhost/smart-rebate-web/web/admin/forgot_password.php

Following is the error I got in apache error log:

[Tue Apr 15 17:10:18 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required 'includes/public-application-header.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/smart-rebate-web/web/admin/forgot_password.php on line 2, referer: http://localhost/smart-rebate-web/web/admin/login.php?lout=1

For your reference I'm attaching the image of my project structure titled 'smart-rebate-web' in Netbeans editor. enter image description here and following is the sceenshot of abrwser after I hit the URL :

http://localhost/smart-rebate-web/web/admin/forgot_password.php

enter image description here

So can anyone please help me in resolving this issue please? Thanks in advance. If you want any further information or any code I can provide you the same. Following asre the permissons of these files if I print in terminal:

-rw-rw-r-- 1 eywa eywa 1646 Apr 14 13:05 application-header.php
-rw------- 1 eywa eywa 1006 Apr 10 18:06 public-application-header.php
Was it helpful?

Solution

You have permission issue. According to your current file permission, only file owner can read and write that file, others cannot read. When you go on browser, default www-data user tries to read that file. And it is not permitted. Make your file 644 or change file owner to www-data. ``www-data` is the apache user used while you open php files from browser. And more flexible way, use following;

require_once(dirname(__FILE__) . "/includes/public-application-header.php");

OTHER TIPS

Try using

require_once('web/admin/includes/<filename>');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top