Help moving Kirby to another hosting :(

Hi,
I’m moving an old instance of Kirby (magazine.landscapestories.net) on a new hosting (http://213.164.204.233/) and I get the error that you see on the link I provided.
The current hosting is bluehost and the new one is vps where I installed nginx instead of apache, but on the docs I’ve read that kirby runs on nginx.

Not sure which is the problem.

Thanks for any help!

That sounds as if the mb_string extension is missing

Thanks! It solved the problem but now it looks like my nginx configuration is not correct. I didnt migrate yet the domain and I’d like to test it with the ip address, but looks like it doesn’t work. I’m not an expert in nginx and if you have further suggestions or point me to the right doc I can try to investigate by myself. Thanks a lot.

It works!

I found the issue. In my footer.php there was something like:

<? foreach($menupages as $menulink): ?>

and I changed to

<?php foreach($menupages as $menulink): ?>

But on my local environment and in the current hosting this is not causing any issue.

The use of short PHP tags <? is generally discouraged, apart from the short echo tag <?=.

You can set your server settings to allow them, but…

Edit: adding phpinfo → http://213.164.204.233/phpinfo.php


Thanks, I double checked all the tags and it was only that one that was causing the issue :slight_smile:

I migrated the full website, however there are still couple of annoying things that I’m struggling to solve.

The first is the image crop. I’ve installed imagemagick and enabled in php, but they are not cropped.

Original from magazine.landscapstories.net:

Current on 213.164.204.233/en:

I’ve also added the specific instructions in the config.php:

// ImageMagick
c::set('thumbs.driver', 'im');
c::set('thumbs.bin','/usr/bin/convert');

and the path is correct for convert.

The other issue I have is with the cache.

If I set it true:

c::set('cache',true)

the website is not showing.

Do the thumbs and cache folders exist and are they writable? Have you cleared the cache folder before moving? (Kirby 2 is so long ago…)

I have an instance on my local machine that I just deploy on bluehost with rsync.

I did the same on the new hosting but yes, folders are writeable and the site/cache is empty:

➜  ~ ls -la /var/www/landscapestories/          
total 60
drwxr-xr-x  8 debian debian 4096 Jan 23 20:58 .
drwxr-xr-x  5 root   root   4096 Jan 22 23:16 ..
drwxr-xr-x  7 debian debian 4096 Jan 22 11:41 assets
drwxr-xr-x 20 debian debian 4096 Jan 22 11:41 content
-rw-r--r--  1 debian debian 1175 Jan 17  2018 .htaccess
-rw-r--r--  1 debian debian  292 Apr 19  2020 index.php
drwxr-xr-x 10 debian debian 4096 Jan 22 11:41 kirby
-rw-r--r--  1 debian debian 6261 Oct 30  2017 license.md
drwxr-xr-x  2 debian debian 4096 Jan 24  2020 newsletter
drwxr-xr-x  4 debian debian 4096 Jan 22 11:41 panel
-rw-r--r--  1 debian debian  183 Jan 23 01:59 phpinfo.php
-rw-r--r--  1 debian debian 1924 Oct 18  2016 readme.md
-rw-r--r--  1 debian debian  110 Nov 13  2017 robots.txt
drwxr-xr-x 11 debian debian 4096 Jan 23 21:36 site

➜  ~ ls -la /var/www/landscapestories/site/cache
total 8
drwxr-xr-x  2 debian debian 4096 Jan 23 21:36 .
drwxr-xr-x 11 debian debian 4096 Jan 23 21:36 .. 

I know the v2 is old, and thanks for the support, but migrating to v3 it is not top priority at the moment. Old hosting will be down on 8 feb and I want to migrate everything before that day :slight_smile: That is why I’m trying to check that everything work well.

I don’t see a thumbs folder though?

yes, you are right.

After you suggestions I’ve seen that there were no folders and I created manually:

➜  ~ ls -la /var/www/landscapestories/site
total 48
drwxr-xr-x 12 debian debian 4096 Jan 23 21:48 .
drwxr-xr-x  8 debian debian 4096 Jan 23 20:58 ..
drwxr-xr-x  2 debian debian 4096 Nov 12  2017 accounts
drwxr-xr-x  2 debian debian 4096 Oct 23  2018 blueprints
drwxrwxrwx  2 debian debian 4096 Jan 23 21:57 cache
drwxr-xr-x  2 debian debian 4096 Jan 23 21:50 config
drwxr-xr-x  2 debian debian 4096 Oct 20  2016 languages
drwxr-xr-x  3 debian debian 4096 Oct 23  2018 plugins
drwxr-xr-x  2 debian debian 4096 Jan 23 01:11 snippets
drwxr-xr-x  2 debian debian 4096 Apr  1  2017 tags
drwxr-xr-x  2 debian debian 4096 Jul 31  2019 templates
drwxrwxrwx  2 debian debian 4096 Jan 23 21:48 thumbs
➜  ~ ls -la /var/www/landscapestories/site/cache 
total 108
drwxrwxrwx  2 debian   debian    4096 Jan 23 21:57 .
drwxr-xr-x 12 debian   debian    4096 Jan 23 21:48 ..
-rw-r--r--  1 www-data www-data 11490 Jan 23 21:49 2e57cba4bc4e1e2422a18eed1a56128d
-rw-r--r--  1 www-data www-data 25165 Jan 23 21:53 5fda0a82b52070c05647293edcfb8f9b
-rw-r--r--  1 www-data www-data 12711 Jan 23 21:45 84c1c1dacf9e05276745d49ac69dd762
-rw-r--r--  1 www-data www-data 44099 Jan 23 21:57 c96a736cd8718e4de986826347777bfe
➜  ~ ls -la /var/www/landscapestories/site/thumbs 
total 8
drwxrwxrwx  2 debian debian 4096 Jan 23 21:48 .
drwxr-xr-x 12 debian debian 4096 Jan 23 21:48 ..
➜  ~ 

As you can see the cache is working, but not the thumbs. I tried to set permission to both folder to 0777 and in the cache folder files are written with 0644.

But thumbs are sill not generated. I’m trying with both GD and imagemagick, but still wondering if it’s a permissions issue or misconfiguration. Is there something that I can check in the log?

The cache folder must be inside the /site folder. And if there is any data in it, you should delete it now.

Edit: Seems to work now.

:heart:

It works!