Hi,
I use Netcup shared hosting with PHP 8.2 and latest Kirby 4.
The frontend works fine. When I develop on my local machine with MAMP or Kirby in build server, the panel login shows a blank page. On live server I get a ERROR 500 (will attach server error logs below).
There are currently two subpages which I simply linked with
<a href="/studio">Studio</a>
inside my code. The first page works yet the second page throws 404 (only on live server).
My page: https://studiovier.xyz/
I use a public folder set up.
On my server I had to set open_basedir
to
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}var{/}lib{/}php{/}sessions
to make it work.
This is my .htaccess
:
# Kirby .htaccess
# revision 2022-09-15
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder;
# otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite,
# set the RewriteBase to:
#
# RewriteBase /mysite
# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /
# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]
# block all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# block direct access to Kirby and the Panel sources
RewriteRule ^kirby/(.*) index.php [L]
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
# pass the Authorization header to PHP
SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1
# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
Just by looking at the server logs, I am unsure if its missing server configurations or if I need to adjust my code base.
Server Logs:
Any hints on what I’m missing?
Is there any difference in folder structure between the two pages studio and residents. Please post the file structure of your content folder.
Hi,
I don’t think so. I added the “studio” page after I created the public folder setup tho.
My folder structure:
Inside 1_residents
and 2_studio
are each a default.txt
and then residents.txt/studio.txt
You can only ever have one txt file (apart from the file meta data files), so you should either have the default.txt or residents.txt/studio.txt (depending on which template you plan to use for each page)
I removed default.txt and then saw that I had ignored the content folder, so the page was simply missing on the server
I still cannot log in to the panel, after enabling debug mode on live I saw that open_basedir restriction is in effect
. I had to change open_basedir
to
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}var{/}lib{/}php{/}sessions
on the server to display the site, without it I get ERROR 500
.
Any hints on how to solve that?
Hi everyone,
I managed to resolve the error on the live site by correcting the assets
path and setting panel.install
in my site/config.php
:
<?php
return [
'debug' => false,
'panel' => [
'favicon' => 'assets/favicon/favicon.ico', //before: '/assets/favicon/favicon.ico',
'install' => true
],
'thumbs' => [
'driver' => 'im',
'bin' => '/opt/homebrew/bin/convert',
]
];
However, I’m still facing issues with image rendering on the live site due to broken paths. Additionally, when I try to access the panel using MAMP or the built-in Kirby server, I get a white screen. I’ve made sure my config.localhost.php
has the same settings as the live config.php
.
I would greatly appreciate any advice or solutions to fix the image rendering issue and the white screen problem.
Not sure if I should open a new topic for that so will try in this thread first.
Thank you in advance for your help!
This is the error message from the console when trying to access the panel on MAMP/in build Kirby server:
It is similar to what this user postet but my accounts folder is empty so I cannot delete anything.
I have moved accounts
and sessions
to a storage
folder and I think have set the correct paths:
<?php
require __DIR__ . '/../kirby/bootstrap.php';
$base = dirname(__DIR__);
$storage = $base . '/storage';
$kirby = new Kirby([
'roots' => [
'index' => __DIR__,
'site' => $base . '/site',
'content' => $base . '/content',
'accounts' => $storage . '/accounts',
'cache' => $storage . '/cache',
'sessions' => $storage . '/sessions',
'logs' => $storage . '/logs',
]
]);
echo $kirby->render();
Your config shows that you are using im
as thumbs driver with a path to the bin file that refers to a local path. Please make sure that ImageMagick is available on the server and if so, correct the path. If not, comment those lines.
As for your local installation. Kirby works out of the box with MAMP. However, those error messages you see in the console makes me think that those files are not copied to the media folder (please check that), probably due to permissions issues. Check if the folder is writable by the webserver user.
And while your custom folder setup looks ok to me, as long as something does not work, I would stick with the default setup. Then make those changes when everything runs properly.
1 Like
yes thank you again
I copied the missing files shown in the console from the live media
folder to my local setup and then everything worked. This is good enough for me for now.
I also work on a very old macbook so might be a problem with that.
After adjusting the path to ImageMagick for the server the images now get displayed.