note 126545 added to function.exec

From: Date: Fri, 29 Oct 2021 11:42:32 +0000
Subject: note 126545 added to function.exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-217125@lists.php.net to get a copy of this message
if you get an error code, like 255 for instance, but can't see the error anywhere (logs, output, files, whatever...) remember to redirect the errors somewhere within the command: <?php $command = "do_stuff -w params -o output"; // redirect the errors to an "errors.txt" file (if the current directory is writable by php or specify a full path) $command1 = $command." 2> errors.txt" // or redirect the errors to the standard output (you get the errors in the $output parameter of exec) $command2 = $command." 2>&1" // get the errors in "errors.txt" $result = exec($command1, $output, $code); // or get the errors in $output $result = exec($command2, $output, $code); ?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 2a01:e0a:940:430:3126:b644:6b1:90ef) ---- Manual Page -- https://php.net/manual/en/function.exec.php Edit -- https://main.php.net/note/edit/126545 Del: integrated -- https://main.php.net/note/delete/126545/integrated Del: useless -- https://main.php.net/note/delete/126545/useless Del: bad code -- https://main.php.net/note/delete/126545/bad+code Del: spam -- https://main.php.net/note/delete/126545/spam Del: non-english -- https://main.php.net/note/delete/126545/non-english Del: in docs -- https://main.php.net/note/delete/126545/in+docs Del: other reasons-- https://main.php.net/note/delete/126545 Reject -- https://main.php.net/note/reject/126545 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217125) next »