muratny Posted August 27, 2007 Share Posted August 27, 2007 Hi, Safe mode is off in php.ini Running php5 as an Apache server module on Fedora /logfiles directory is 777 owned by 'apache', 'apache' cannot fopen("/logfiles/a.txt","w"); here... /logfiles/b.txt file is 777 owned by 'apache', 'apache' cannot fopen("/logfiles/a.txt","a"); here... I just want to write to a file anywhere, anyhow, Any help would greaty be appreciated, going crazy, thanks, m. Quote Link to comment https://forums.phpfreaks.com/topic/66920-is_writable-returns-false-no-matter-whatwhere/ Share on other sites More sharing options...
hitman6003 Posted August 28, 2007 Share Posted August 28, 2007 Stupid question, but, is "/logfiles" a directory named "logfiles" in the root partition of your server, or is it a folder in the docroot of Apache? What is the exact error given? Quote Link to comment https://forums.phpfreaks.com/topic/66920-is_writable-returns-false-no-matter-whatwhere/#findComment-335818 Share on other sites More sharing options...
btherl Posted August 28, 2007 Share Posted August 28, 2007 Try this: system("ls -l /logfiles/a.txt"); fopen("/logfiles/a.txt","w"); Does it show the file you are trying to open? Also, are you using SELinux? Check what's in /etc/selinux/config Quote Link to comment https://forums.phpfreaks.com/topic/66920-is_writable-returns-false-no-matter-whatwhere/#findComment-335863 Share on other sites More sharing options...
muratny Posted August 28, 2007 Author Share Posted August 28, 2007 after pulling out lots of hair, this fixed it: cd / chcon -t httpd_sys_content_t -R logfiles thanks for all the replies, much appreciated, Murat Quote Link to comment https://forums.phpfreaks.com/topic/66920-is_writable-returns-false-no-matter-whatwhere/#findComment-336178 Share on other sites More sharing options...
btherl Posted August 29, 2007 Share Posted August 29, 2007 For any other people who might find this thread later, chcon is an SELinux command. That's a permissions system that runs on top of chmod, meaning BOTH conditions must be satisfied to get access. Quote Link to comment https://forums.phpfreaks.com/topic/66920-is_writable-returns-false-no-matter-whatwhere/#findComment-336826 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.