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!
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Dear All,
Is there a PHP command, such as [php_man]exec()[/php_man], that I can use that will suspend operation until the completion and termination of the command given in exec(). To give an example;
I'm talking about a generic approach. I simply want a shell execution command that doesn't continue processing the PHP script until after the command has been executed.
So for instance above, I would want the PHP script to suspend execution for 10 seconds. exec() would start, and then wait until the command had finished before resuming the PHP script. In this sense, if I echoed 'start' before exec() and 'finish' after there would be a 10 second delay between echoing 'start' and 'finish'.
Also, exec() doesn't seem to report any errors even if I put a random program that doesn't exist into its brackets ().
Hi phpScott, I'm actually now using system('cmd', $retval).
The return value is consistently reporting as 127, with no varience whether I put a random program (non-existant) command into system() or one that exists. The last line, which system(), always returns an empty string.
I've noticed from phpinfo() that the server is currently running in safe mode - could this be anything to do with it? Is there something else that I should be looking for?