Forum


Replies: 6   Views: 3633
Empty document if two users create at the same time
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Bluecoat Systems  · 09-01-2014 - 10:42

Hi, I have been testing out the creation of the Docs ( Corperate latest version ) and everything has been great. But just noticed that when two users run reports at the same time only 1 gets created.



In the temp directory the unique files are created and temp directories and these also get deleted at the end of the creation process.



But in the final destination, 1 contains the content and 1 is empty.



If I run them 1 after the other they both work so I know the process works its just when they are run at the same time.



Is there a way too get around this or do you have any clue why this would do this.



thanks



G.



 


Posted by jorgelj  · 09-01-2014 - 11:11

Hello,



Please post how are you running PHP (web server and mod_php, FastCGI, php_fpm...) and any special config in your server. Are you using APC or any other opcode?



Regards.


Posted by Bluecoat Systems  · 09-01-2014 - 12:03

Hi, here are the server details. 



PHP Version 5.4.10

Windows NT SWSVL-SGAWEB-01 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586

IIS 7

CGI/FastCGI



No Opcode at this time.



I have been testing with various elements like file location, removing templates but still the same, only the 1st file is saved.



I also ran the check.php and all green.



thanks



G.



 


Posted by jorgelj  · 10-01-2014 - 07:45

Hi,



Please try the same test running two simple examples: easy/Text.php and easy/Template.php and post the results. PHPDocX uses some static variables that maybe are not cleaned on your server and there's a race condition.



Could you attach both documents to check them?



Regards.


Posted by Bluecoat Systems  · 13-01-2014 - 09:15

Will do, it will be sometime later this week.



G.


Posted by Bluecoat Systems  · 17-01-2014 - 13:49

Hi, I just did some testing and found out it was me at fault. I had a clean up process to delete JSON Created images, but I was deleting the whole directory and not just the images for the report. Thus when the other report was being process and came to insert the images they were gone and thus reported back a 0 size file as missing objects.



Thanks



G