Welcome! Log In Create A New Profile

Advanced

PHP exec function failing to execute certain commands

Posted by cahalsall 
PHP exec function failing to execute certain commands
November 23, 2021 07:48PM
The following code ran fine in PHP under apache but is failing to run under nginx/php-fpm:

exec( "/usr/bin/xvfb-run -a -s '-screen 0 640x480x16' /usr/bin/wkhtmltopdf --page-size Letter --margin-top 10 --margin-bottom 10 $url $tempPDF" );

I've been through all the configuration files but nothing I've done seems to work, not even the error logs are reporting anything.

This server was initially configured by the iRedMail installation script.
Re: PHP exec function failing to execute certain commands
November 24, 2021 12:32PM
I would also like to add that this works fine from the command line.
Re: PHP exec function failing to execute certain commands
December 15, 2021 09:39PM
This issue was solved by adding the following line to /etc/php-fpm.d/www.conf:

env[PATH] = '/usr/local/bin:/usr/bin:/bin'
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready