tags:

views:

24

answers:

2

Hi, While i try to deploy the code devloped on wamp server on the dev machine on linux , i get this error: Warning: require_once(/PHP file) [function.require-once]: failed to open stream: No such file or directory in /var/www/proj/index.php on line 38

Fatal error: require_once() [function.require]: Failed opening required '/PHP file' (include_path='.:/var/www/proj:/var/www/proj/framework:') in /var/www/proj/index.php on line 38

Now the PHP file i called is in the path "/var/www/proj/framework"

A: 

You have just supplied wrong filename.
Use proper path to this PHP file

Col. Shrapnel
well i double checked the file name.. that is not the case..
Nauman Bashir
@Nauman that IS the case. Because PHP has checked it. And told you so.
Col. Shrapnel
+1  A: 
require_once("/PHP file")

is using an absolute path and looking for PHP file in the server's filesystem root directory

require_once("./PHP file")

or

require_once("PHP file")

is a relative path that would search for PHP file using the include path

Mark Baker
well that was the case.. actually the wamp server overlooked the / in the command : require_once(/PHP file), i removed the / for the linux server n it worked. thanks
Nauman Bashir