Please check the php.ini file to see what your tmp folder is actually called and where it is located.
Either mpdf is using the wrong tmp folder or php is...
Please check the php.ini file to see what your tmp folder is actually called and where it is located.
Either mpdf is using the wrong tmp folder or php is...
Hi,
I had the same issue, for me it seemed to be the "open_basedir" restriction, even if I had the Php /tmp/ dir writeable and in my Php.ini for the specific site,
Perhaps not the solution, but when I set "open_basedir none" it works, although I really do not like this setting from a Security Point of View....
But it is a step forward perhaps, in troubleshooting ?
Edit:
When setting the open_base paths back and have the correct dirs setup and permissions, the 500 Internal Error comes back, when trying to print..
Change the owner of the directory "/path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/" to the webserver user/group; this should resolve the permissions issue. I had to run the following command:
$ chown apache:apache /path/to/osticket/include/mpdf/vendor/mpdf/mpdf/tmp/
This may differ for your server so please lookup the right way to change ownerships on your server.
In tandem with this, you will need to apply these pull requests:
- https://github.com/osTicket/osTicket/pull/4815
- https://github.com/osTicket/osTicket/pull/4814
After all this you should be able to print PDF no problem.
Cheers.
KevinTheJedi
Hi Kevin and thanks for your assistance.
I made the two fixes you reported and my Host manager told me that the permissions are correct. I'm attaching JPGs of permits, are they correct?
I have clean installation but it doesn't work, the PDF doesn't print, thanks.
Then you should be receiving an error in your Apache/PHP error logs. We need these errors for further assistance.
Cheers.
Hi,
osticket uses the system temp folder for generating the pdf and not mpdf/tmp. So check what sys_get_temp_dir() returns for you and set the permissions for osticket on that folder, or use the 'sys_temp_dir' ini directive to set it to a folder that is writable.
Hi Kevin, mi log error:
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] PHP Fatal error: Uncaught RuntimeException: SplFileInfo::isFile(): open_basedir restriction in effect. File(/tmp/mysql.sock) is not within the allowed path(s): (/home/www/:/tmp:/usr/local/php7/lib/php/) in /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php:92, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] Stack trace:, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #0 /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php(92): SplFileInfo->isFile(), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #1 /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(9392): Mpdf\Cache->clearOld(), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #2 /home/www/web234/html/test/include/class.pdf.php(51): Mpdf\Mpdf->Output('Ticket-ABS45483...', 'S'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #3 /home/www/web234/html/test/include/class.ticket.php(3125): mPDFWithLocalImages->output('Ticket-ABS45483...', 'S'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #4 /home/www/web234/html/test/scp/tickets.php(498): Ticket->pdfExport('A4', '0'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] #5 {main}, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:27 2019] [error] [client 89.97.217.102] thrown in /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 92, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:32 2019] [error] [client 89.97.217.102] PHP Warning: Invalid argument supplied for foreach() in /home/www/web234/html/test/include/staff/templates/queue-tickets.tmpl.php on line 393, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] PHP Fatal error: Uncaught RuntimeException: SplFileInfo::isFile(): open_basedir restriction in effect. File(/tmp/mysql.sock) is not within the allowed path(s): (/home/www/:/tmp:/usr/local/php7/lib/php/) in /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php:92, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] Stack trace:, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #0 /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php(92): SplFileInfo->isFile(), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #1 /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(9392): Mpdf\Cache->clearOld(), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #2 /home/www/web234/html/test/include/class.pdf.php(51): Mpdf\Mpdf->Output('Ticket-ABS45483...', 'S'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #3 /home/www/web234/html/test/include/class.ticket.php(3125): mPDFWithLocalImages->output('Ticket-ABS45483...', 'S'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #4 /home/www/web234/html/test/scp/tickets.php(498): Ticket->pdfExport('A4', '1'), referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] #5 {main}, referer: http://test.absyachts.com/scp/tickets.php?id=87
[Tue May 07 17:50:37 2019] [error] [client 89.97.217.102] thrown in /home/www/web234/html/test/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 92, referer: http://test.absyachts.com/scp/tickets.php?id=87
If I comment the function as below it deletes the session links in / tmp, work! Can I leave it like this or write without deleting it in the / tmp?
Thank
/** @var \DirectoryIterator $item */
//foreach ($iterator as $item) {
// if (!$item->isDot()
// && $item->isFile()
// && !$this->isDotFile($item)
// && $this->isOld($item)) {
//
// unlink($item->getPathname());
// }
// }
Maybe this will help you:
https://www.templatemonster.com/help/open_basedir-restriction-in-effect-filex-is-not-within-the-allowed-paths-y.html
Essentially your /tmp/mysql.sock
file is not accessible as /tmp
is not in open_basedir
's allowed paths. All you need to do is add the /tmp
directory to your open_basedir
's allowed paths or move your socket to a directory that's already in your allowed paths.
Cheers.
Hi I am having the same problem and cannot exactly work out why.
I am using,
Os tickets version 1.12
PHP Version 7.2.19
Cent OS 6.10
MySQL version 5.1.73
My PHP error log displays the following:
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: PHP Fatal error: Uncaught RuntimeException: SplFileInfo::isFile(): open_basedir restriction in effect. File(/tmp/plesk_17.8.11_installation.log) is not within the allowed path(s): (/var/www/vhosts/website.net/:/tmp/) in /var/www/vhosts/website.net/support/include/mpdf/vendor/mpdf/mpdf/src/Cache.php:92, referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: Stack trace:, referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #0 /var/www/vhosts/website.net/support/include/mpdf/vendor/mpdf/mpdf/src/Cache.php(92): SplFileInfo->isFile(), referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #1 /var/www/vhosts/website.net/support/include/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(9392): Mpdf\Cache->clearOld(), referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #2 /var/www/vhosts/website.net/support/include/class.pdf.php(51): Mpdf\Mpdf->Output('Ticket-666647.p...', 'S'), referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #3 /var/www/vhosts/website.net/support/include/class.ticket.php(3125): mPDFWithLocalImages->output('Ticket-666647.p...', 'S'), referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #4 /var/www/vhosts/website.net/support/scp/tickets.php(498): Ticket->pdfExport('A4', '0'), referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: #5 {main}, referer: https://support.website.net/scp/tickets.php?id=2352
[Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: thrown in /var/www/vhosts/website.net/support/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 92, referer: https://support.website.net/scp/tickets.php?id=2352
Please advise and provide direction.
macsoluk [Thu Jun 27 13:06:14 2019] [warn] [client 213.123.193.35] mod_fcgid: stderr: PHP Fatal error: Uncaught RuntimeException: SplFileInfo::isFile(): open_basedir restriction in effect. File(/tmp/plesk_17.8.11_installation.log) is not within the allowed path(s): (/var/www/vhosts/website.net/:/tmp/) in /var/www/vhosts/website.net/support/include/mpdf/vendor/mpdf/mpdf/src/Cache.php:92, referer: https://support.website.net/scp/tickets.php?id=2352
php open basedir appears to be preventing stuff from running properly.
I would recommend that you fix that first. See if that solves the issue.
If it does not then we can look at the new error.
Hi there,
similar issue here. Upgraded to 1.12 from 1.10. Printing worked prior to the upgrade, no other system changes made. MYSQL PHP and IIS are all exactly the same as they were prior to the upgrade. PHP error log does not show anything when this error happens.
Server Information
osTicket Version v1.12 (a076918) — Up to date
Web Server Software Microsoft-IIS/10.0
MySQL Version 8.0.14
PHP Version 7.0.33