I encounter Array to string conversion ErrorException when trying to generate a PDF on my production server running CentOS.
$pdf->download(strtolower('file.pdf');
However, the same code run perfectly on my local development machine running Windows 10 with MAMP installation.

After spending few hours trying to figure out the issue and I found that the error comes from $env variable in vendor/symfony/process/Process.php
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $env, $this->options);
I am able to print out the $env array when I dd() the $env just before the line $this->process = ...

I can bypass the exception if I purposely put some dummy data in env variable inside my config file /laravel/config/snappy.php or set $env to null in $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $env, $this->options)
'pdf' => array(
'enabled' => true,
'binary' => env('SNAPPY_PDF_BINARY'),
'timeout' => false,
'options' => array(),
'env' => [
'test' => 'test'
],
),
I can't figure out what's the real problem here and hope to get some helps here.
Thanks.
I believe it might be this issue https://github.com/symfony/symfony/pull/25559
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy.
If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
Most helpful comment
I believe it might be this issue https://github.com/symfony/symfony/pull/25559