[thelist] system background process php

Mark Groen evolt at markgroen.com
Thu Apr 29 09:08:25 CDT 2010


Bob Meetin wrote:
> I have a script that use convert to resize a file into several various 
> sizes, works fine, but I think of the number of resizes it is taking 
> so long that it causes mysql to time out.  I see errors like: Warning: 
> MySQL server has gone away
>
> The relevant code looks like:
>
> <?php
> system("convert  $file -resize 400 '$newfile'");
> ...
> ...
> ?>
>
> I know you can run PHP in the background, but how would I tell it to 
> run a system command in a php script in the background.
> And as well fix the timeout.  Anything to do with may_packets_allowed?
>
> -bob
The difference perhaps between local speed and HG may be whom owns the 
Apache daemon at the time the script is running. Guessing your local 
server is running as root user and HG has properly configured Apache for 
you as just a user. Permissions are also likely to be the answer also 
for needing a temp file.

What kind of file is being resized? By chance an image file, is there an 
improvement using ImageMagick?

cheers,

    Mark
--




More information about the thelist mailing list