0

I am trying to run

shell_exec('composer self-update');

but it will not output anything when visiting a page that has that with apache2. When I use the same file with the PHP CLI it works and returns I have the latest version. shell_exec and exec are not on my disabled functions, and I have used

ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL);

to see if it returns anything and it does not. Putting the shell_exec output in a variable and dumping the variable returns NULL. I am using Apache/2.4.38 on Raspberry Pi OS Buster (formerly Raspbian) with PHP 7.3-fpm.

isteiger
  • 3
  • 4
  • Maybe this answer can help you: https://stackoverflow.com/questions/16626218/composer-phar-dont-want-to-run-by-shell-exec-from-php-script-why – Baracuda078 Jul 29 '20 at 18:34
  • The issue is that it writes the messages to standard error, not standard output. – Barmar Jul 29 '20 at 18:35

0 Answers0