passthru
(PHP 4, PHP 5)
passthru — Execute an external program and display raw output
Description
void passthru
( string $command
[, int &$return_var
] )
Parameters
-
command
-
The command that will be executed.
-
return_var
-
If the return_var
argument is present, the
return status of the Unix command will be placed here.
Return Values
No value is returned.
Notes
WarningWhen allowing user-supplied data to be
passed to this function, use
escapeshellarg() or escapeshellcmd()
to ensure that users cannot trick the system into executing arbitrary
commands.
Note: If a program is started with this function,
in order for it to continue running in the background, the output of the
program must be redirected to a file or another output stream. Failing to do so
will cause PHP to hang until the execution of the program ends.
Note: When
safe mode is enabled, you can only
execute files within the safe_mode_exec_dir.
For practical reasons, it is currently not allowed to have ..
components in the path to the executable.
WarningWith safe mode enabled,
the command string is escaped with escapeshellcmd(). Thus,
echo y | echo x becomes echo y \| echo x.