Oct 30
tsb t asked:
Respected Sir,
I am getting some problem while using fopen command while i try to run the script in the mozilla firefox
i am getting the error like tis
Warning: fopen(welcome.txt) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\trail\file.php on line 5
and my actual code is like this
< ?php
$file=fopen("welcome.txt","r");
?>
and i wanna say another thing also this code s running in internet explorer.
So plz give me the solution for this..
Thanking you
Savitha Bhargav
3 Responses to “Regarding file management in php?”
Leave a Reply















November 1st, 2008 at 7:13 am
well the problem is you have not created welcome.txt file if you had it would not have given you this error. Make sure the file welcome.txt is in the same folder as the script, else you will need to specify full path.
November 3rd, 2008 at 1:16 pm
Make sure you’ve created welcome.txt and it’s in the right directory, if that’s ok try this
November 5th, 2008 at 11:56 pm
Perhaps you’re looking to write to the file? In PHP you can open a file with fopen using the w or a flag in the second argument. That will create the file for you if it doesn’t exist.
But if you are looking to read the file, then it just doesn’t exist at the moment. Create it and the error will go away.
Adam @