I followed these instructions to create a .env
From http://octobercms.com/docs/setup/configuration#environment-config-extended
Defining a base environment It is often helpful to have different configuration values based on the environment the application is running in. You can do this by setting the APP_ENV >environment variable which by default it is set to production. There are two common ways to change this value:
Set APP_ENV value directly with your webserver.
For example, in Apache this line can be added to the .htaccess or httpd.config file:
SetEnv APP_ENV "dev" Create a .env file in the root directory with the following content:
APP_ENV=dev In both of the above examples, the environment is set to the new value dev. Configuration files can now be created in the path config/dev and will >override the application's base configuration.
Here is my php code:
use Initbiz\Pdfgenerator\Classes\PdfGenerator;
/*
* OctoberCMS AJAX handler to download PDF
*/
public function onDownloadPdf() {
$pdfGenerator = new PdfGenerator();
//Set absolute path of the Twig layout
//$pdfGenerator->layout = plugins_path().'/initbiz/exampleplugin/views/pdf/pdflayout.htm';
$pdfGenerator->layout = plugins_path(). '/deltarv/products/views/pdf/part.htm';
//Set filename for downloaded file
$pdfGenerator->filename = "Part PDF";
//Set data which will be sent to the layout
$pdfGenerator->data = ['viewData' => 'Value of viewData'];
$pdfGenerator->generatePdf();
return $pdfGenerator->downloadPdf();
}
Here is the error:
"The exit status code '126' says something went wrong: stderr: "sh: /home/deltarv/public_html/plugins/initbiz/pdfgenerator/vendor/bin/wkhtmltopdf->amd64: Permission denied" ... ETC ETC
Is my .env the problem does it need to point to a specific path?
This is what I got.
APP_ENV=dev
WKHTMLTOPDF_BINARY