When going into a ticket, and printing via the print button we get the print ticket options, select paper size and then get a This page isn’t working osticket.website is currently unable to handle this request.
HTTP ERROR 500

This has only happend since the upgrade to 1.11

Tested everything bar the printing on out test system and have checked and can replicate in there as well

All user affected...

Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance. The more information you give us the better we will be able to assist you. Thank you.

Environment details?
PHP errors?

I am unable to replicate this issue.

Environment is

osTicket Version v1.11 (d4e240b) — Up to date
Web Server Software Microsoft-IIS/8.0
MySQL Version 5.5.45
PHP Version 7.0.27

There is nothing in the PHP logs either, previous to the upgrade, running 1.10 in the same environment, printing worked..

Just recreated the error, and checked the php error log straight away, and no error, but the error on the page is still

This page isn’t working osticket.website is currently unable to handle this request.
HTTP ERROR 500

@DaveA

Run this in PHP and see if it returns an output:

echo sys_get_temp_dir();

Cheers.

    KevinTheJedi Hi Kevin

    Thanks for the reply, Not sure if I did this right, as I am running php on windows and IIS, but opened an interactive php promp and ran the above and nothing

    I ran php.exe -a is this the right way to do this?

    Thanks for your help

    Dave

    create a tmp.php file.
    put <?php echo sys_get_temp_dir(); ?> in it.
    at the cmd line type php tmp.php

    @DaveA

    If you do as @ntozier said and you still get an empty output then this is the issue. We use a third party PDF generator called mPDF and mPDF needs a temporary directory to put things whilst building the PDF. If your system has no temporary directory this will fail. In order for this to work you must configure PHP with a temporary directory. Almost 99% of the time there is already a temp directory configured so not sure if you guys deleted yours, changed permissions on yours, etc. but all you need to do is create a temp dir and configure PHP to use this as the temp directory.

    Cheers.

    side note: By default PHP ini has a tmp dir set last time I checked.

    There is a temp directory, and just to eliminate any potential permissions issue, I went onto out Windows IIS Server (logged in as domain admin), and opend the website on there, and tried to print a ticket, and still got a 500 error.

    Have checked the folder, and as an Admin on the server itself no reason that permissions should be an issue.

    Can't see what has changed as we just did a straight upgrade from 1.10 and ticket printing was fine then....it was the one thing I didn't test on the system before upgrading the live one...

    Other people who don't have the issue, are any of them running a wimp stack? (No not a wamp, we run a wimp windows, iis, MySQL, php)

    Any ideas and all your help so far greatly appreciated...

    Dave

    Yes. I am run IIS 8.5 with PHP 7.2 and I do not have a problem with printing.

    It does seem to take a little longer than it did previously though (but that might be just my perception).

    Should point out, that I also ran this, as in the windows environment to ensure the files were not listed as blocked

    dir -Path [directory path] -Recurse | Unblock-File

    Thanks for everyone's helps o far, sadly no resolution yet....

    a month later

    Hi,
    the same problem .
    Clean installation v1.11 , only in English with PHP 5.6 or 7 SQL 5.6.36 and PDF does not work, open page with error 500 but with OsTicket 1.10 everything works fine. Solutions?
    UP

      absolute Still the same issue and have yet to find a resolution

      Hi Kevin,
      my error:
      Warning: unlink(/tmp/sess_pu4rlc1eoq3s580adc53mjsa77): Operation not permitted in /home/www/web234/html/aftersalesservices/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 95

      Warning: unlink(/tmp/sess_5243a79468c4d7d69ae74f8aa9f7778c): Operation not permitted in /home/www/web234/html/aftersalesservices/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 95

      Warning: unlink(/tmp/tmp.rbuMe23399): Operation not permitted in /home/www/web234/html/aftersalesservices/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 95

      Warning: unlink(/tmp/sess_b565e4e63284fbf77adad191d7c87749): Operation not permitted in /home/www/web234/html/aftersalesservices/include/mpdf/vendor/mpdf/mpdf/src/Cache.php on line 95

      Thanks

      unlink() is a PHP directive that deletes a file.
      sess_* is a session file.
      operation not permitted means that either PHP does not have permissions to remove the file it created [this could either be the folder that it resides in, the file permissions itself, or the ownership of the file], or you are some how blocking the directive from being run.

        ntozier
        Thanks Ntozier.

        With OsTicket 10.1 and 10.5, PDF printing works. With OsTicket 11.1 it does not work. The php temp directory of my server is called phptemp not tmp. Can this be the problem? I can't edit that folder. Can I change the location of this temporary folder somewhere?
        Thank you.

        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..