Error: “Notice: Undefined offset: 1 in /web/contao-manager.phar.php on line 61”

This is an archive post. It will not be updated.

The error message

You actually just wanted to open the Contao Manager, but instead of the expected login window you see this unfamiliar error message:

Notice: Undefined offset: 1 in /web/contao-manager.phar.php on line 61
Warning: Cannot modify header information - headers already sent by (output started at /web/contao-manager.phar.php:61) in /web/contao-manager.phar.php on line 102

Welcome to the club. This error message showed up for me in the winter of 2019 during a very long night shift. Bleary-eyed, I stared at the monitor and couldn’t make sense of it. It cost me half the night before I realised what simple mistake I had made …

The solution to the riddle

In short: it’s down to the address used to call up the Contao Manager. The file originally comes from contao.org as contao-manager.phar and we developers have to rename it to contao-manager.phar.php when uploading it to the server. So far, so good.

The error message above appears if you call up the address in the browser with just /contao-manager.phar instead of /contao-manager.phar.php. That’s it. Nothing more and nothing less. Simply call up the Contao Manager on your domain correctly with .phar.php instead of just .phar at the end, and the error is gone and you land on the login window.

You’re welcome

I have a soft spot for all late-night workers. Hopefully nobody will ever have to spend hours hunting for such a silly mistake again.
It’s enough that it happened to me *wink*.