Jump to content

What does PHP exec() return value of 5 mean?


ternto333

Recommended Posts

In the command

exec($command, $return_array, $return_value), 

$return_array is empty and $return_value returns 5. I am unfamiliar with the return value of 5. I know if the command successfully executes, a return value of 0 is expected.

 

I am running this command from the web and when I run the exact command from the command line, it works fine. Any thoughts?

exec() and system() are php shell functions that just pass a call to the server's OS ... anything that exec() or system() returns is whatever the shell returned.  The host language (in this case, PHP) is very much 'out of the loop' when it comes to shell commands.

 

A return status of 5 from a shell of 'ping' could mean one thing on winblows and something totally different on Linux. Additionally, the return of INT(5) could mean one thing to 'ping' but something totally different to 'netstat' ... etc.

 

What command are you shelling and to what OS?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.