Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

si-andrew's avatar

index.php error: Call to a member function send() on null

Hello, I've been developing a laravel website on my local development environment and it's ready now to launch it to a production server. It's not my first time launching laravel websites to production servers, but it is my first time launching to a shared hosting server. It's being launched to a 1&1 shared server, which is running PHP 7.0.7 which is what my homestead environment is running, but on the shared host I'm getting a fatal error when I load up the website that I can't figure out:

ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function send() on null' in /path-to-laravel-install/public/index.php:55
Stack trace:
#0 {main}  

So, obviously the $response object isn't instantiating correctly... but that's as much as I've able to determine.

Other than switching to a VPS (which yes, would be the best option), does anyone have any idea what could cause this error in Laravel? Since it must be a server setting, I did read through https://laracasts.com/discuss/channels/servers/developing-andor-deploying-laravel-on-1and1com-shared-hosting already and I checked to make sure that the website's php_info() dump does indicate that all of the requirements https://laravel.com/docs/5.2/installation#server-requirements are being met.

Thank you!

0 likes
1 reply
si-andrew's avatar
si-andrew
OP
Best Answer
Level 2

Well, it turns out that it wasn't a server issue at all. I had modified the App\Exceptions\Handler file and it was preforming correctly when the website's .env file's debug mode was set to true, but not when it was set to false (the parent::render() method wasn't getting called when debug mode was turned off). When I first uploaded the website, i put it in maintenance mode while I was getting the database and things in order, and so it was hitting the exceptions handler right away.

Problem solved.

4 likes

Please or to participate in this conversation.