Jump to content

forking php


anatak

Recommended Posts

Hello all,

 

I would like to get some opinions on forking php.

 

I have a form that let users upload pictures.

after the upload the picture is resized

 

the resizing takes some time because the picture gets resized in a big version and a thumbnail version and then saved to the right folder.

 

the problem is that while the picture is resized / saved nothing else works.

 

would that be solved by forking the picture resizing routine ?

 

thanks

anatak

Link to comment
https://forums.phpfreaks.com/topic/177609-forking-php/
Share on other sites

do you mean a cron job that runs every minute ?

I don't think my hosting will be happy with that.

 

Or do you mean a cron job that I trigger from the php upload page ?

If you let php trigger a cron job that runs a php script wouldn't that be resource intensive ?

 

 

 

at this moment the upload works fine now I just want to resize the picture.

Link to comment
https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936564
Share on other sites

Cron uses very little resources, your host shouldn't care at all.

 

Or do you mean a cron job that I trigger from the php upload page ?

 

That doesn't make much sense.

 

As for forking a php script, you could try executing another php script in the cli background via exec.

 

Why not just use pcntl_fork() ?

Link to comment
https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936592
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.