PHP Classes

Its no longer working.

Recommend this page to a friend!

      File cache class  >  All threads  >  Its no longer working.  >  (Un) Subscribe thread alerts  
Subject:Its no longer working.
Summary:Package rating comment
Messages:9
Author:Moazam
Date:2008-06-27 23:24:27
Update:2011-02-17 02:25:44
 

Moazam rated this package as follows:

Utility: Good
Consistency: Good
Documentation: Sufficient
Examples: Sufficient

  1. Its no longer working.   Reply   Report abuse  
Picture of Moazam Moazam - 2008-06-27 23:24:27
Its no longer working. I have tested it on windows machine all i am getting this error. Error: could not write the cache headers: could not write to the cache file

It creates the file but it does not write the file.

  2. Re: Its no longer working.   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-06-29 00:42:01 - In reply to message 1 from Moazam
This class requires PHP file locking functions to work properly. Depending on your Windows file system, it may not work as file locking is not supported by all Windows file systems. It is a Windows limitation problem, not PHP's.

  3. Re: Its no longer working.   Reply   Report abuse  
Picture of Moazam Moazam - 2008-07-01 09:02:53 - In reply to message 2 from Manuel Lemos
flock works fine on windows server 2003. I am using WAMP.

  4. Re: Its no longer working.   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-07-01 13:07:34 - In reply to message 3 from Moazam
The problem is dealing with file locking on multithreaded Windows Web servers like IIS. I am afraid two parallel file locking requests coming from different threads does not work on Windows.

  5. Re: Its no longer working.   Reply   Report abuse  
Picture of Moazam Moazam - 2008-07-01 14:07:04 - In reply to message 4 from Manuel Lemos
there are no parallel requests.. because i am using it alone. Windows is not my production server and i am not fool to choose windows for php production server ;) I tried it on linux and it works fine. Perhaps i have to figure out some way to run it on my development machine.

Thanks

  6. Re: Its no longer working.   Reply   Report abuse  
Picture of vunguyen vunguyen - 2008-08-10 16:00:23 - In reply to message 4 from Manuel Lemos
Maybe you should add a method to set off flock when not desired?
It's rather annoying when working under windows dev machine (xampp)

Regards

  7. Re: Its no longer working.   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-04-30 05:19:48 - In reply to message 6 from vunguyen
Sorry for the delay.

Without locking you can't assure that two simultaneous accesses will not cause cache file corruption.

Anyway, it seems that Windows problem is more when you store cache files in partitions with FAT file systems.

  8. Re: Its no longer working.   Reply   Report abuse  
Picture of nidal09 nidal09 - 2011-02-17 02:06:57 - In reply to message 7 from Manuel Lemos
when flock block the access to the files, is it possible that the other simultaneous requests will hang until the file is unlocked and cause a server crash ?

should the lock be non-blocking using LOCK_NB ?

  9. Re: Its no longer working.   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-02-17 02:25:45 - In reply to message 8 from nidal09
No, when processes die all acquired locks are released, at least in Linux/Unix.