Execute file in server after window is closed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
avix
Forum Newbie
Posts: 2
Joined: Sun Jan 23, 2011 10:27 am

Execute file in server after window is closed

Post by avix »

I have made a php script which will take 4-5 hours to run completely so instead of running that file from browser if we could run it on server like a back-end process .so if it's posiible how we can do this.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: Execute file in server after window is closed

Post by greyhoundcode »

A cron job might fit the bill. Read this.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Execute file in server after window is closed

Post by califdon »

That, or use a language that wasn't specifically designed to be run from browsers, such as PERL.
sockpuppet
Forum Newbie
Posts: 22
Joined: Tue Jan 18, 2011 8:38 am

Re: Execute file in server after window is closed

Post by sockpuppet »

If you have SSH access then you can run it from the command line. Though with califdon on this one I'd use PERL, it's very PHP like (or is PHP very PERL like?) so its not hard to pick up the differences in the language.
Post Reply