Page 1 of 1

Warning: Unknown: failed to open stream: Permission denied i

PostPosted: 14. March 2005 12:21
by Druid Healer
I placed a script in htdocs... and tried to run it in Opera but when I did, I got this message.

Code: Select all
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Warning: Unknown: Failed opening '/opt/lampp/htdocs/abc_2.6.php' for inclusion (include_path='.:/opt/lampp/lib/php') in Unknown on line 0


There is nothing on the first line except <?... which i changed to <?php to make sure it wasn't that or something and the second line is just a comment.

I ran a hello world script on xampp and encountered the same message, until it stopped and restarted it. After that the hello script ran.

I know the the script that is encountering this error message works because I have tested it on a different server. It does not access the mysql database and the script has worked on xampp for windows.

PostPosted: 14. March 2005 18:52
by Oswald
Dear Druid!

I assume your file is not readable by the Apache. Try the following command:

chmod a+r /opt/lampp/htdocs/abc_2.6.php

Now reload the page and the error should disappear.

Greetings
Oswald

PostPosted: 14. March 2005 23:49
by Druid Healer
Thanks a lot! I didn't realise it wasnt working because it was from a zip file with no permissions! :oops: Is there anyway to change the permissions of a lot of files at once?

PostPosted: 15. March 2005 00:22
by Oswald
Try

chmod -R a+rX /opt/lampp/htdocs

Changes the permission of all files in htdocs and every sub directory.

In most cases this should give the best results. (Upper case R and X are important!)

Greetings
Oswald

PostPosted: 17. March 2005 17:36
by Druid Healer
It worked :D! Thnx!