开发者

PHP, server and file permission

I am using a PHP application to generate links to files. Links are basically PHP files (abcd.php) with permission 644 put into a directory public with permission 755.

When I try to access public/abcd.php via browser I get a 500 Internal Server Error. If I change the file permission to 755, the system works.

I am using a cheap web server so I do not have much access to logs. What can be the cause of the problem? Can I solve the开发者_开发问答 issue?

Thanks


644 on any server side script is likely to have problems because no executable flag is set

644 means that the owner can read and write and the rest of the world can read

755 means that the owner can do everything and the rest of the world can read and execute.

By rest of the world I really mean, other users on the server (eg. Apache which is likely to be the web server that your hosting runs upon)


Maybe PHP run as CGI on your server, and not as an Apache DSO module, so it needs the execution bit.

Try a phpinfo() to see if PHP run as CGI...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜