anatak Posted October 13, 2009 Share Posted October 13, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/ Share on other sites More sharing options...
MadTechie Posted October 13, 2009 Share Posted October 13, 2009 You could have a 1 minute cron for the resize and a queue folder, as for upload your need to use something client side like java/flash. Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936455 Share on other sites More sharing options...
anatak Posted October 14, 2009 Author Share Posted October 14, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936564 Share on other sites More sharing options...
trq Posted October 14, 2009 Share Posted October 14, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936577 Share on other sites More sharing options...
Prismatic Posted October 14, 2009 Share Posted October 14, 2009 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() ? Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936592 Share on other sites More sharing options...
trq Posted October 14, 2009 Share Posted October 14, 2009 Why not just use pcntl_fork() ? Because this is a web environment the OP is refering to. Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936594 Share on other sites More sharing options...
Prismatic Posted October 14, 2009 Share Posted October 14, 2009 Why not just use pcntl_fork() ? Because this is a web environment the OP is refering to. Oh, right. My bad. Quote Link to comment https://forums.phpfreaks.com/topic/177609-forking-php/#findComment-936615 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.