& Amp; lt ;? Php {code ...}? & Amp; gt; can be successfully executed, but the printed value is 1. is it true that it is not 1? Only errors are returned.
$cmd = system("wget http://la-lg.hostus.us/500MB.test",$r);echo $r;
?>
It can be successfully executed, but the printed value is 1. isn't it 1 in principle? Only errors are returned.
Reply content:
$cmd = system("wget http://la-lg.hostus.us/500MB.test",$r);echo $r;
?>
It can be successfully executed, but the printed value is 1. isn't it 1 in principle? Only errors are returned.
Let's take a look at the official documents:
If the command output is successful, the last line is returned. if the command output fails, FALSE is returned.
Let's take a look at the English version:
Returns the last line of the command output on success, and FALSE on failure.
In fact, both of these statements may cause ambiguity. the correct understanding should be
If the command succeeds, the exit code of the command is returned.
That is
exit(code)
Incode.
In most cases,exit(0)Indicates no error. However, this does not mean all.
For specific commandsman wget
The result is as follows:
EXIT STATUS Wget may return one of several error codes if it encounters problems. 0 No problems occurred. 1 Generic error code. 2 Parse error---for instance, when parsing command-line options, the .wgetrc or .netrc... 3 File I/O error. 4 Network failure. 5 SSL verification failure. 6 Username/password authentication failure. 7 Protocol errors. 8 Server issued an error response. With the exceptions of 0 and 1, the lower-numbered exit codes take precedence over higher-numbered ones, when multiple types of errors are encountered.
Therefore, "0" means "success", while "1" means "error.
Is your file downloaded successfully?
-What exactly does 1 mean?
MB file? Timeout