Query: passthru
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PASSTHRU(3) 1 PASSTHRU(3) passthru - Execute an external program and display raw outputSYNOPSISvoid passthru (string $command, [int &$return_var])DESCRIPTIONThe passthru(3) function is similar to the exec(3) function in that it executes a $command. This function should be used in place of exec(3) or system(3) when the output from the Unix command is binary data which needs to be passed directly back to the browser. A common use for this is to execute something like the pbmplus utilities that can output an image stream directly. By setting the Content-type to image/gif and then calling a pbmplus program to output a gif, you can create PHP scripts that output images directly.PARAMETERSo $command - The command that will be executed. o $return_var - If the $return_var argument is present, the return status of the Unix command will be placed here.RETURN VALUESNo value is returned.NOTESWarning When allowing user-supplied data to be passed to this function, use escapeshellarg(3) or escapeshellcmd(3) to ensure that users can- not 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. Warning With safe mode enabled, the command string is escaped with escapeshellcmd(3). Thus, echo y | echo x becomes echo y | echo x.SEE ALSOexec(3), system(3), popen(3), escapeshellcmd(3), backtick operator. PHP Documentation Group PASSTHRU(3)
Related Man Pages |
---|
imagegif(3) - php |
proc_open(3) - php |
echo(3) - php |
mb_output_handler(3) - php |
odbc_binmode(3) - php |
Similar Topics in the Unix Linux Community |
---|
What does this Unix command do? |
Run external program in background |
Echo and a command's output on the same line |
Storing the output of a Unix cmd in my C program |
Redirect Problem |