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
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.