IrOnMaSk Posted July 21, 2011 Share Posted July 21, 2011 Hi guys, So I want to run one of my php page as a process. I don't want it to run on a browser because it'w be just a blank page. I've been searching and I know the function is shell_exec... But I don't know how to use this function... And if it's not too much asking i want to call it from a batch file... I know the batch scripting part, it would be just (start then the path to the page)... any help or idea would be much appreciated, thanks Quote Link to comment https://forums.phpfreaks.com/topic/242553-run-as-background-process/ Share on other sites More sharing options...
premiso Posted July 21, 2011 Share Posted July 21, 2011 http://php.net/cli Its called the command line interface. Batch file mockup @echo off c:\path\to\php.exe -f c:\path\to\script.php Quote Link to comment https://forums.phpfreaks.com/topic/242553-run-as-background-process/#findComment-1245683 Share on other sites More sharing options...
IrOnMaSk Posted July 21, 2011 Author Share Posted July 21, 2011 thankx for the help Premiso. So I read the manual, and i'ma just gonna stick with your example lol.... so what are the php.exe and script.php. I'm guessing the script.php is the php file i want to execute in the CLI but what is the php.exe per se? thankx, Quote Link to comment https://forums.phpfreaks.com/topic/242553-run-as-background-process/#findComment-1245709 Share on other sites More sharing options...
premiso Posted July 21, 2011 Share Posted July 21, 2011 The php.exe is the php executable...it is what runs everything to do with PHP. If you are using Apache as a web server, well Apache calls that executable to execute any php code it has, it just does it behind the scenes so to speak. Without that executable file, well PHP wouldn't work on your server. Quote Link to comment https://forums.phpfreaks.com/topic/242553-run-as-background-process/#findComment-1245711 Share on other sites More sharing options...
IrOnMaSk Posted July 21, 2011 Author Share Posted July 21, 2011 thanks man, right after i asked that question found the answer, and tested and it worked fine. you're the best, thanks very much, Premiso, you should change that to Supremiso!!!! Quote Link to comment https://forums.phpfreaks.com/topic/242553-run-as-background-process/#findComment-1245749 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.