“no input file specified” in Contao 4 at TimmeHosting

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

Initial situation and error message

I moved an existing Contao website to a managed server at the web host TimmeHosting. When I tried to open the website or, alternatively, the Contao Manager, I was greeted with the error message “No input file specified”.

This confused me a lot, since in the (sub)domain configuration I had even selected the configuration for Contao 4.4 predefined by TimmeHosting and assumed that it should work.

Default path at TimmeHosting

At TimmeHosting, the data for a project website is usually located in a path such as:
/var/www/clients/client1/web1/web

Important: The web folders appearing here have nothing to do with Contao yet; they are standard in the server configuration of the managed servers at TimmeHosting.

TimmeHosting knows that since version 4, Contao additionally needs its own /web folder, which also contains the Contao Manager. Accordingly, TimmeHosting obviously assumes that the Contao administrator creates another /web folder in the default root. So the default path for the first website on the server would be:
/var/www/clients/client1/web1/web/web

This last web folder would then contain the file contao-manager.phar.php.

My wish: more order, i.e. an additional subfolder

I wanted a bit more order, so I had created a subfolder in the default root – let’s call it “testprojekt” – and inside it the obligatory web folder for Contao.

So my desired root path looked like this:
/var/www/clients/client1/web1/web/testprojekt/web

When creating the subdomain in ISPConfig, I had accordingly redefined the base folder, so that the subdomain points to my new web folder in the subfolder “testprojekt”. Based on the help text at that point, I assumed that I had to enter web/testprojekt/web as the base path.

For the desired configuration (nginx directives or nginx snippets), I selected the configuration for Contao 4 provided by TimmeHosting.

The result when opening Contao or the Contao Manager was the error message mentioned above, “No input file specified”. No recognizable entry in the log files, just that.

The solution

Fortunately, the solution is very simple: my base path setting for the (sub)domain was wrong. I had assumed that I had to define the final path, as I know it from other web hosts, so that the subdomain treats the last web folder I created as its root. Normally, that would be correct.

By choosing the Contao 4 configuration for nginx, however, things are different, because TimmeHosting has already hard-wired the web subfolder into this configuration. Accordingly, my base path combined with the Contao 4 configuration created a path that does not exist.

The solution to the puzzle was to delete the subdomain, create it again, select the Contao 4 variant as the configuration again, but this time enter the base path without Contao’s final web folder:
web/testprojekt

After waiting a few minutes until the new subdomain was running with the configuration, Contao 4 was purring like a kitten again (and super fast on top of that, thanks to the speedy server!)

Important: This setting for the base domain applies if you work with a subdomain (vHost) or alias domain (vHost). If, on the other hand, you work in ISPConfig under “Webseiten > Webseite”, you can set the “abweichenden Document Root” (custom document root) in the advanced settings there. If you want to point to the folder “testprojekt” here, don’t enter web/testprojekt, just testprojekt.

Why? Because at that point the server assumes the preceding path anyway and only needs the addition for the subfolder. That is probably standard for classic server administrators, but the different presentation in the interface confused me.