Hyssar Posted August 16, 2007 Share Posted August 16, 2007 First of all .... no! the needed rights are allowed to the repository!!! Ok, I can start I got a forum/wiki application I made. During all those weeks, I developped and tested it on Windows XP SP2. When bringing it on my Linux server, I can't modify those .txt and .inc files. I can create a simple .txt file with touch(), it proves I got the writing rights, but the fwrite() and fputs() fonctions have no effect. About my server : it is a Linux Kubuntu system (yes, I know that for some of you a graphical server is heresy, but I don't care at all about the 0,5% lost in managing graphical environment, it only easier to remotly (freenx,ssh) maintain it when it's graphical). Kubuntu Edgy 6.10 Apache 2.0.55 PHP 5.1.6 Thanks ! Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/ Share on other sites More sharing options...
btherl Posted August 17, 2007 Share Posted August 17, 2007 Please post your code, along with any warning or error messages. Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326398 Share on other sites More sharing options...
solarisuser Posted August 17, 2007 Share Posted August 17, 2007 While you (your uid/gid) can touch a file, the web server probably doesn't have permission because it runs as apache or nobody. If you 'tail -f <path/to/apache/error_log>', you might see the error, or php's error_log (defines in /etc/php.ini). If you can't find any of those files and don't care about security, just 'chmod -R 777 ~', and it should be able to write anywhere in your directory, but other users will too. Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326425 Share on other sites More sharing options...
keeB Posted August 17, 2007 Share Posted August 17, 2007 Also, just because you have rights to touch a new file, doesn't mean your access rights are valid for the files you're trying to read. Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326439 Share on other sites More sharing options...
Hyssar Posted August 17, 2007 Author Share Posted August 17, 2007 About the access rights, I opened a root konqueror and right-clicked the directory www and changed the rights for every users, it is : can read and write But I will also try the chmod -R 777 ~ The apache server is started as hyssar, wich is the main user (and hyssar has writing rights in www and all sub directories and files) The code : (it worked perfectly on windows, so I REALLY don't think it could be the problem.....) simply, fopen flock fwrite flock fclose Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326596 Share on other sites More sharing options...
Hyssar Posted August 17, 2007 Author Share Posted August 17, 2007 Today, an apache upgrade has been avaible on Adept, after installation, I tested the script and...... IT WORKS ! Lucky! And thanks everybody! Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326600 Share on other sites More sharing options...
keeB Posted August 17, 2007 Share Posted August 17, 2007 the update probably chowned your dir to apache:apache or something to that effect, giving your script full read/write Quote Link to comment https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/#findComment-326732 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.