Error 500 when trying to access Panel

Hi,

I’m trying to access my dashboard within Kirby, but it’s throwing an error.

HTTP ERROR 500 – This page isn’t working

Edit and add the following lines in my .htaccess file

RewriteBase /
Options -Multiviews

My website is installed within a subdomain in the following directory:

/var/www/mywebsite

Check and I have my PHP module called mbstring installed.

Also check my Apache configuration and if I have the AllowOverride all option enabled inside my / var/www directory.

<Directory "/var/www">
    AllowOverride all
    Require all granted
</Directory>

I await your response and comments.

Thank you!

Is that a new project or an old one? Kirby 2 is no longer supported and should therefore not be used for new projects because there will be no updates anymore.

Apart from that, do other pages apart from the homepage on the frontend work?

Hi pixelijn,

Thank you very much for the information, it is a project that started when version 2 was still old and it just went into production.

The front pages if they are used and navigated correctly. The problem is only caused when trying to enter the administrative panel.

Check the official Kirby documentation on version 2 and verify each step, but it still does not work.

:link: Installation issues

I await your response or comments.

Thank you!

Have you checked if you get an error on the frontend if you put some garbage into your .htaccess?

And how did you check if the mb_string module is enabled? Make sure it’s not only there but also enabled.

Hi pixelijn,

No, I haven’t tried that option from the .htaccess file yet.

I will try in a moment more and I will warn you or notify you of anything.

Thank you very much for your answer and help.

Hi pixelijn,

My module called mbstring, verify it through the command console or terminal.

Attachment screenshot:



Thank you very much for your answer and help.

Hi pixelijn,

The server does recognize the .htaccess file.

Add garbage words and it throws me error once I upload it.

This means that my .htaccess file works correctly.

I await your response or comments.

Thank you!

Please check your server error logs if there is any more information. Which PHP version is running on the server?

Hi pixelijn,

My version of PHP is the following:

PHP Version => 7.2.24

The errors it throws on my server are the following:


[Fri Jun 25 13:34:41.039117 2021]
[proxy_fcgi:error]
[pid 1117260: tid 139817266431744]
[client 127.000.000.000:52463]
AH01071: Got error 'PHP message: PHP Warning:  session_start(): open(/var/lib/php/session/sess_8l8e9ovh6e28n4jo40k8rb31fm, O_RDWR) failed: Permission denied (13) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): open(/var/lib/php/session/sess_8l8e9ovh6e28n4jo40k8rb31fm, O_RDWR) failed: Permission denied (13) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): open(/var/lib/php/session/sess_8l8e9ovh6e28n4jo40k8rb31fm, O_RDWR) failed: Permission denied (13) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): open(/var/lib/php/session/sess_8l8e9ovh6e28n4jo40k8rb31fm, O_RDWR) failed: Permission denied (13) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Warning:  session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/s.php on line 64\nPHP message: PHP Fatal error:  Uncaught Error: Call to undefined function json_decode() in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php:82\nStack trace:\n#0 /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php(44): {closure}('{\\n    "cancel":...')\n#1 /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php(58): Data::decode('{\\n    "cancel":...', 'json')\n#2 /var/www/mywebsite/panel/app/src/panel/translation.php(59): Data::read('/var/www/amcarg...')\n#3 /var/www/mywebsite/panel/app/src/panel.php(118): Kirby\\Panel\\Translation->load()\n#4 /var/www/mywebsite/panel/index.php(41): Kirby\\Panel->__construct(Object(Kirby), '/var/www/amcarg...')\n#5 {main}\n  thrown in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php on line 82\n'

I await your response or comments.

Thank you!

That sounds as if the webserver can’t write to the /site/sessions folder. Make sure that your file/folder permissions and ownership are correct.

Hi pixelijn,

I have verified the permissions for my folders or directories as well as the permissions for the files and they are correct.

Permissions:

directories => 0755
files => 0644

I await your response or comments.

Thank you!

You might want to check out this thread

I’m running out of ideas.

What is your Kirby 2 version anyway?

Hi pixelijn,

My version of Kirby is the following:

version => 2.5.12

Check the error that I shared with you earlier in my folder in the following directory:

/var/lib/php/session

It did not contain the required permissions to create sessions.

Right now I have changed them, but it keeps throwing me a new error in my error_log file:


[Fri Jun 25 15:09:16.663047 2021]
[proxy_fcgi:error]
[pid 1565819:tid 139817341933312]
[client 127.000.000.000:36356]

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error:
Call to undefined function json_decode() in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php:82

Stack trace:

#0 /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php(44): {closure}('{\\n    "cancel":...')\n
#1 /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php(58): Data::decode('{\\n    "cancel":...', 'json')
#2 /var/www/mywebsite/panel/app/src/panel/translation.php(59): Data::read('/var/www/mywebsite...')\n
#3 /var/www/mywebsite/panel/app/src/panel.php(118): Kirby\\Panel\\Translation->load()
#4 /var/www/mywebsite/panel/index.php(41): Kirby\\Panel->__construct(Object(Kirby), '/var/www/mywebsite...')
#5 {main}\n  thrown in /var/www/mywebsite/kirby/vendor/getkirby/toolkit/lib/data.php on line 82\n'

I await your response or comments.

Thank you!

Looks like there are some PHP modules (in this case the json module) missing, which seems weird given that its such a standard. Are you on shared hosting or is this your own server? Make sure to enable all relevant modules if its your server or check what you can enable in your hosters cPanel or whatever they have available. Or contact the provider for support.

Hi texnixe,

Perfect, thank you very much for your help.

I will install the PHP json module to try again to access the Kirby administrative panel.

I notify you of anything or comment.

Thanks!

Hi texnixe,

My web hosting provider helped me install the PHP JSON module. It was installed correctly and now the login for the administrative panel is displayed, but now it is throwing me the following error:

Attachment screenshot:



Check all the permissions of my directories are correct and recommended:

directories => 0755
files => 0644

Also check my error.log file again but it is not throwing any errors.

I await your response or comments.

Thank you!

Make sure that the permissions are applied to all subfolders/files.

But permissions is not enough, you also need the correct ownership, usually the webserver user/group is www-data on Apache.

Hi texnixe,

Ok, perfect, thank you very much for the answer.

Do you have any information or links regarding such www-data configuration that Kirby requires, I would greatly appreciate it.

I await your response or comments.

Thank you!

That has nothing to do with Kirby in particular, but with file/folder permissions needed for a webserver user to be able to execute and write files.

If you would set permissions to 777/666, you wouldn’t have this problem, because then anyone could read, write and execute files. But of course, that would be very insecure. Hence the file ownership is important to prevent having to set such wide permissions.