Welcome Guest, Not a member yet? Register   Sign In
Displaying PDF
#1

(This post was last modified: 06-20-2018, 01:20 PM by donpwinston.)

I've been getting errors in my php_error_log file. The error occur in pairs (same timestamp). But my application runs fine.

[15-Jun-2018 11:33:42 America/New_York] PHP Fatal error:  Uncaught ErrorException: Cannot modify header information - headers already sent in /opt/lampp/htdocs/system/Debug/Exceptions.php:139

Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/opt/lampp/htdo...', 139, Array)
#1 /opt/lampp/htdocs/system/Debug/Exceptions.php(139): header('HTTP/1.1 500 In...', true, 500)
#2 /opt/lampp/htdocs/system/Debug/Exceptions.php(200): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#3 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#4 {main}
  thrown in /opt/lampp/htdocs/system/Debug/Exceptions.php on line 139

The relevant code called from a controller is:

PHP Code:
...
header('Cache-Control: private');
header('Content-type: application/pdf');
ob_clean();
flush();
readfile($file);
... 

Any ideas?
Simpler is always better
Reply


Messages In This Thread
Displaying PDF - by donpwinston - 06-15-2018, 10:14 AM
RE: Displaying PDF - by donpwinston - 06-20-2018, 01:23 PM
RE: Displaying PDF - by InsiteFX - 06-21-2018, 03:02 AM
RE: Displaying PDF - by donpwinston - 04-25-2019, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB