开发者

Executing several Python scripts at same time causes PHP/Apache to hang

I'm trying to execute a few python scripts in order to manipulate some images on my website. The external program/tool is written in python and is called PHATCH. I'm under Windows and using WAMP as my web server.

Executing only just one script seems to work well, but I need to execute 4 scripts at the same time (to generate 4 different images), my browser will just load and Apache/PHP freezes.

The PHP execution seems to freeze and hung up due several system() calls after each other. Here's an example of how I'm using it:

开发者_JAVA技巧
system("C:\\python\\python.exe C:\\phatch\\phatch.py script1.phatch");
system("C:\\python\\python.exe C:\\phatch\\phatch.py script2.phatch");
system("C:\\python\\python.exe C:\\phatch\\phatch.py script3.phatch");
system("C:\\python\\python.exe C:\\phatch\\phatch.py script4.phatch");

If I only do the first one, it's fine, but as soon as I add the others, it all freezes.


Can multiple copies of phatch be executed simultaneously from the same account? Have you tried this without PHP and Apache?

it is possible that multiple copies starting at the same time access the same files, perhaps use the same temporary files (even with unique names, if the name is based on time, they might have the same name...)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜