Images not loading with starter-kit and XAMPP

Hi there I have a problem with getting started with Kirby’s starter-kit. We’re using Kirby as part of a course for students to get started with building websites.

We’re working with a default install of XAMPP in the classroom. After copying the contents of the starter-kit folder to our htdocs folder, Kirby works, our subpages work (after copying the hidden .htaccess file) but our images are not loading. What might be the solution in this case?

Kind regards,

Jasper

Do you get any error messages in the PHP error logs or server logs? Do images get created in the /media folder? Maybe a memory limit setting or something like that. What does phpinfo() say?

Hi @texnixe, Images are not created in the media folder. going to /panel also gives the following error: The panel assets cannot be installed properly. Please check permissions of your media folder.

phpinfo() gives the full output as expected, do I need to look at specific settings? Or should I look at permissions first?

Yes, make sure your permissions are right first, because that’s what the Panel says. Seems like the Panel assets cannot be written to the media folder either, resulting in the Panel not working.

The folders and files must be writable by the Apache user.

Ok, I’ve tried changing the permissions on the media folder to 755/644 but that does not solve the problem. Other options?

What if you change them to 777/666 for testing only?

Ok, some progress:

The session storage directory "/opt/lampp/htdocs/site/sessions" is not writable

Note that the /content folder, the /site/accounts folder, the /site/cache folder need write rights as well. We usually recommend 755/644 on all folders/files.

Right, everything works on my local machine. Is there a default shell script that could take care of setting proper permissions? That would save us quite a bit of trouble in the classroom with setting up ±30 simultaneous Kirby installations…

Not that I know, but you could create one yourself based on this example

#!/bin/sh
DIRS="assets content kirby panel site thumbs"
FILES="index.php"

for dir in $DIRS;do
 sudo chown -R www-data.www-data "$dir"
 find "$dir" -type d -print0 | xargs -0r sudo chmod 775
 find "$dir" -type f -print0 | xargs -0r sudo chmod 664
 find "$dir" -type f \( -name *.pl -o -name *.cgi \) -print0 | xargs -0r sudo chmod 775
done

for file in $FILES;do
 sudo chown www-data.www-data "$file"
 sudo chmod 664 "$file"
done

exit 0;

This is an old one I used with Kirby 2, so you would have to adapt it for Kirby 3 with the folder names and the right Apache user (or if that is not necessary in your case, leave that part out).

Hey @texnixe thanks! For now we ended up solving it with a quick 777 oneliner. As we’re just doing local development it suffices for what we’re doing right now. Obviously not something you’d do in a production environment (as one of my more security oriented students pointed out!)

Good guy!