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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.