Jump to content

Recommended Posts

First off, I'm using Fedora, in case that has anything to do with this.

I'm trying to write a log program which will basically repeatedly open a file, write to it, close the file. The problem is, even with the simplest file operations, php doesn't release the write lock on the file.

 

#!/usr/bin/php -q
<?php
$a = fopen('out2.txt','ab');
fclose($a);
?>

when run from the desktop, the result is a file on my desktop with the "write lock" icon on it. The script then terminates, but the lock never goes away.

Anybody know what's up with that?

 

-IsmAvatar

It's probably not a "write lock" on the file, but a permission issue. 

 

Whenever a file is on the desktop that you don't have permissions on, it shows up with a lock (su to root, set the umask to 077 and create a file on the logged in user's desktop...you'll see the same lock on the icon).  Add yourself to the same group as the apache user and make sure the group has read/write permissions.  Or chmod the file (as root) to 777, then see if the lock goes away.

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.