Page 1 of 1

PHP exec, calling executable programs

Posted: October 13th, 2008, 20:52
by ProfHawking
Calling all PHP wizards:

i want a PHP script to be able to kick off an exe on the server it is running on. its running on apache on a windows 2003 server.

i have been fiddling with the exec() function to no avail so far.

the application doesn't have to return any variables to php, and may take time to run so the php processor shouldn't wait for it.

Does anyone know how to do it?

Posted: October 14th, 2008, 0:11
by ProfHawking
scratch that

cracked it eventually

Posted: October 14th, 2008, 0:32
by buzzmong
How'd you do it Prof? I know php has a number of commands to run external programs, but it's been 6 months since I last did anything in php and the knowledge has gone *poof*.

I remember exec() being one of the most used though.

Posted: October 14th, 2008, 9:44
by ProfHawking
i used system() in the end. not sure why exec() wasnt working...
but anyway code ended up like this:

Code: Select all

Weird, i get:

Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. 

when i try to post the code. even inside [ codes ]


if anyone has any suggestions as to how it could be improved or run separately that would be appreciated, at the moment the rest of the PHP waits for the sync.exe to finish its syncing :P