Jump to content

[SOLVED] fwrite/fputs problem on Linux


Hyssar

Recommended Posts

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 !

Link to comment
https://forums.phpfreaks.com/topic/65326-solved-fwritefputs-problem-on-linux/
Share on other sites

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.