IsmAvatar Posted May 2, 2008 Share Posted May 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/103907-solved-fclose-not-releasing-write-lock-on-fedora/ Share on other sites More sharing options...
hitman6003 Posted May 2, 2008 Share Posted May 2, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/103907-solved-fclose-not-releasing-write-lock-on-fedora/#findComment-532134 Share on other sites More sharing options...
IsmAvatar Posted May 3, 2008 Author Share Posted May 3, 2008 Ah, that would probably explain it. I don't have access to my fedora box right now, but I'm going to say this is solved now. Quote Link to comment https://forums.phpfreaks.com/topic/103907-solved-fclose-not-releasing-write-lock-on-fedora/#findComment-532188 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.