I need my PATH environment variable to include /usr/local/bin when seen from PHP, so that I can execute binaries that are in /usr/local/bin with exec() in PHP code without writing their full path, e.g. exec("ffmpeg");
If from php I run echo getenv("PATH") it outputs: /sbin:/usr/sbin:/bin:/usr/bin
However if I log into the server as root via ssh and I write in the terminal echo $PATH I get: //sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
So the /usr/local/bin is already included when I log into the command line, but not when PHP is run.
So how do I add directories to the path environment variable in such a way that they are recognized also by PHP?
I tried to add SetEnv PATH $PATH:/usr/local/bin to /var/www/vhosts/mydomain.net/conf/vhost.conf (which contains other directives which do have effect), but it doesn't change a thing. I also tried by adding that to a .htaccess file (dunnow if it made sense) but it didn't work either.
I already searched the forum and found a lot of similar or identical questions but no answer, or at least none that works.