@khat17
The 1.10.x series does not include upgraded mPDF and that's why printing works with v1.10.7 and below. With upgraded mPDF (osTicket v1.12+) they defaulted to the system's temp directory which started causing these issues for shared hosts with open_basedir
restrictions. All you would realistically need to do is Disable open_basdir
completely. I understand that your host will not do this so I will walk you through how to configure a new temp directory for mPDF (it's not that difficult so don't worry).
Let's start by creating a new tmp folder under the mPDF directory (/path/to/osticket/include/mpdf/vendor/mpdf/mpdf/
) in osTicket (if it doesn't already exist). You can name it anything but I'll use /path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/
as an example (as it's already existing in my instance). Once you create /path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/
you will allow full permissions to this directory for the webserver user (if not done so already). Next, grab the full path to the new temp dir which would be /path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/
in this example. Now, go to open_basedir
settings, add the full path the the new temp directory, and Save Changes. Now you will need to go to osTicket and edit the pdf class to reference the new temp directory and Save Changes. See below:
include/class.pdf.php - Line 73
- parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>sys_get_temp_dir()]);
+ parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>'/path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/']);
include/class.pdf.php - Line 114
- parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>sys_get_temp_dir()]);
+ parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>'/path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/']);
Once that's complete restart Apache and PHP if you can and retest the PDF printing. Hopefully this works for you and you can start printing again!
Cheers.