note 68647 deleted from function.shell-exec by cmb
| From: | cmb@php.net | Date: | Sun, 14 Jul 2019 11:34:43 +0000 |
| Subject: | note 68647 deleted from function.shell-exec by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211590@lists.php.net to get a copy of this message | ||
Note Submitter: Kishan
----
If you are on windows and has Cygwin, You can execute all your Cygwin binaries using shell_exec() as
follows:
<?
$result = shell_exec("C:\cygwin\bin\bash.exe --login -c
'/cygdrive/c/cygwin/bin/convert.exe --version'");
print($result);
?>
The key is the "--login" option which appends all the required common cygwin binary and
library paths to $PATH. Without this option some of the cygwin binaries that links to other
libraries ( Like ImageMagick binaries which links to X11 ) will not work and you may see errors like
"cygX11-6.dll not found, Could not start convert.exe"