| Author |
Message |
hanscom Hangin' Around

Joined: Oct 16, 2003 Posts: 31
|
Posted:
Tue May 13, 2008 6:21 am |
|
Hi,
I have a log file on my site which has to be updated by the script:
<?php
$fp = fopen($logfile, "ab");
if(flock($fp, LOCK_EX)){
fwrite($fp, $s);
flock($fp, LOCK_UN);
}
fclose($fp);
?>
It worked for 1.5 years without problems, but a few weeks ago only
incidentally a record is added. Most of the time the file cannot be locked.
My webhost provider uses php 4.4.7
However, my KISGB works great. And I saw that KISGB has a file addtogb.php
where flock() is also used and without problems to update $path_to_gb.
I would like to know the trick and how I can modify my script.
Thanks in advance and regards.
Hans |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15221 Location: Kansas
|
Posted:
Wed May 14, 2008 2:50 pm |
|
If the code "suddenly" stopped working and you have made no changes, then check what changes your host may have made. Also verify that the file permissions/ownership are the same as the KISGB file. That may answer your question right off  |
|
|
|
 |
hanscom Hangin' Around

Joined: Oct 16, 2003 Posts: 31
|
Posted:
Thu May 15, 2008 1:45 am |
|
Last week I informed my host about the problems. I only got a standard message from them that they received my complaint.
Permissions of dirs and files are the same as in KISGB. Also tryed 777 and 666.
I checked with phpinfo.php . It is a Linux syatem build jan 2008 |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15221 Location: Kansas
|
Posted:
Thu May 15, 2008 9:11 am |
|
Check the ownership of the 2 files to be sure they are the same, not only the permissions. If your host has taken a week and not gotten back with you then I'd be looking for a new host. |
|
|
|
 |
hanscom Hangin' Around

Joined: Oct 16, 2003 Posts: 31
|
Posted:
Thu May 15, 2008 10:14 am |
|
How to check ownership of a file?
Do you refer to files on my website?
I will consider the 2-nd tip. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15221 Location: Kansas
|
Posted:
Thu May 15, 2008 10:22 am |
|
How to check ownership of a file?
Use ftp client usually or have host verify.
Do you refer to files on my website?
Yes. The logfile you can't lock and the KISGB file you can lock.
I will consider the 2-nd tip.
 |
|
|
|
 |
hanscom Hangin' Around

Joined: Oct 16, 2003 Posts: 31
|
Posted:
Fri May 16, 2008 6:02 am |
|
It is not yet clear to me how to check ownership.
I use WS_FTP |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7458 Location: Arizona
|
Posted:
Fri May 16, 2008 6:10 am |
|
Most good quality FTP clients (which I believe WS_FTP is one of them) have a way for you to change your remote view panel to show the "Owner/Group". If you cannot find this within WS_FTP, you can definitely do this using FileZilla (free from |
|
|
|
 |
|
|
|
|