|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77645 Error in the exec function
Submitted: 2019-02-21 09:40 UTC Modified: -
From: ailiangkuai at qq dot com Assigned:
Status: Open Package: Unknown/Other Function
PHP Version: 7.1.26 OS: CentOS release 6.8 (Final)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-02-21 09:40 UTC] ailiangkuai at qq dot com
From manual page:
i want execute linux shell via php.if the shell works fine,the $output will be filled with every line of output from the shell script.but if shell script has error,$output is filled whith nothing. i have used the func of python which is commands.getoutput,Get the result regardless of whether the script has an error.

Test script:
$lastOutput = exec("gunzip < /backup-files/test.sql.gz | mysql -u*** -p'***' --host=localhost --database=test",$output,$return_var);


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 02:01:25 2019 UTC