I installed a Kirby 3.5 project I’ve been working on for a while on my server but unfortunately all pages are blank white pages. So far i tried the following steps to debug:
- Tested that the
index.php in the
web directory is loaded. I replaced
echo (new Kirby)->render(); to echo a simple string which worked.
- Tested the connection to
kirby/bootstrap.php by moving the kirby folder somewhere else. This resulted in an error message that the file couldn’t be found, as expected.
- Tested if
kirby/bootstrap.php actually finds the autoload. It did.
- I verified that the vendor folder is in the right spot and all dependencies installed correctly.
- Checked whether mbstring php extension is enabled as I read in another thread this could lead to blank pages.
composer update to make sure the autoload is up to date.
optimize-autoloader in the
The weird thing is I used an identical deployment setup on another server for a different website and its working just fine. I compared both setups and couldn’t find a difference.
Any help would be greatly appreciated. Thanks in advance!
Is there anything in the server error logs?
Have you checked you have no whitespace before the PHP opening tag, particularly in config.php?
I had a look at it and other php files and didn’t find any whitespaces. In my config.php I require a plugin for env files after the php opening tag but that shouldn’t be a problem right? It looks like this:
require_once __DIR__ . '/../plugins/dotenv/global.php';
'dir' => realpath(__DIR__ . '/../../'),
'file' => '.env',
# my config goes here ..
This setup is working fine on my local machine
Have you made sure you have no duplicate kirby folder, i.e. one in
vendor and one in web root?
I only have a Kirby folder in the web directory. There is the
getkirby package in the vendor folder but it only consists of the
I noticed that a plugin I’m using that requires Kirby and that has its own vendor folder inside the plugin directory installed seemingly all dependencies that Kirby requires. There isn’t a Kirby folder in there but could these duplicate dependencies be enough to mess with Kirby?
Okay follow up: I disabled the plugin and removed every call to it and the problem is gone! Great. So the duplicates seem to be the problem. How would I go about installing a plugin’s composer dependencies properly though? Is there a way to make sure composer doesn’t handle plugins and the general installation separately?
Are all plugins installed via composer as well? Which plugin requires Kirby in its composer file in production?
The plugin is this one. Earlier I wrote that I had a functional setup that was the same as on the site this thread is about but I now noticed that on the older site I didn’t gitignore the plugin’s
vendor folder. This time I did add the
vendor folder to the
.gitignore and added the composer install in the plugin’s directory to my build steps.
Maybe it’s wrong to build the plugin? Considering the author pushed a vendor folder to the git repo maybe I am misunderstanding the use of the plugin’s
The dotenv plugin is the only ‘outside’ plugin I use. I wrote a bunch of block plugins but they aren’t hosted anywhere besides my company’s git repos. Would it be better to require outside plugins through composer?
Yes, I think so. That should actually avoid such issues if you are using composer anyway.
I see. I’ll look into it. Thanks for your help! I’ll make sure to use your affiliate link for the next licenses I need.