Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all, be sure that you (=user under which php runs) are allowed to call the external program (OS access rights, safe_mode setting in php.ini). Then you have quite a few options in PHP to call programs via command line. The most common I use are:</p> <hr /> <p><a href="http://de.php.net/system" rel="nofollow noreferrer">system</a></p> <p>This function returns false if the command failed or the <em>last</em> line of the returned output.</p> <pre><code>$lastLine = system('...'); </code></pre> <p><a href="http://de.php.net/manual/en/function.shell-exec.php" rel="nofollow noreferrer">shell_exec</a> or <a href="http://de.php.net/manual/en/language.operators.execution.php" rel="nofollow noreferrer">backtick operators</a></p> <p>This function/operator return the whole output of the command as a string.</p> <pre><code>$output = shell_exec('...'); // or: $output = `...`; </code></pre> <p><a href="http://de.php.net/manual/en/function.exec.php" rel="nofollow noreferrer">exec</a></p> <p>This function returns the <em>last</em> line of the output of the command. But you can give it a second argument that then contains <em>all</em> lines from the command output. </p> <pre><code>$lastLine = exec('...'); // or capturing all lines from output: $lastLine = exec('...', $allLines); </code></pre> <hr /> <p>Here is the overview of all functions for these usecases: <a href="http://de.php.net/manual/en/ref.exec.php" rel="nofollow noreferrer">http://de.php.net/manual/en/ref.exec.php</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload