I have been using a public folder setup with 4.3.0 successfully.
Changing to 4.5.0 has caused an error.
I have removed server.php and changed my package.json script to
"server": "php -S localhost:8888 -t public_html ./kirby/router.php",
My index.php is in public_html and looks like this
<?php
include __DIR__ . '/../vendor/autoload.php';
$kirby = new Kirby\Cms\App([
'roots' => [
'index' => __DIR__,
'base' => $base = dirname(__DIR__),
'content' => $base . '/content',
'site' => $base . '/site',
'storage' => $storage = $base . '/storage',
'accounts' => $storage . '/accounts',
'cache' => $storage . '/cache',
'sessions' => $storage . '/sessions',
]
]);
echo $kirby->render();
My file structure looks like this
texnixe
January 20, 2025, 12:49pm
2
What was the error? There shouldn’t have been a need to make any changes to the setup.
This is the error ’ Fatal error : Uncaught Error: Class “Kirby\Toolkit\Config” not found in C:\Kirby\NC4\kirby\src\Cms\App.php:1030 Stack trace: #0 C:\Kirby\NC4\kirby\src\Cms\App.php(106): Kirby\Cms\App->optionsFromConfig() #1 C:\Kirby\NC4\public_html\index.php(5): Kirby\Cms\App->__construct(Array) #2 C:\Kirby\NC4\kirby\router.php(15): require(‘C:\Kirby\NC4\pu…’) #3 {main} Next Error: Class “Kirby\Toolkit\Str” not found in C:\Kirby\NC4\kirby\src\Http\Environment.php:904 Stack trace: #0 C:\Kirby\NC4\kirby\src\Http\Environment.php(885): Kirby\Http\Environment::sanitizeHost(‘localhost’) #1 C:\Kirby\NC4\kirby\src\Http\Environment.php(875): Kirby\Http\Environment::sanitize(‘SERVER_NAME’, ‘localhost’) #2 C:\Kirby\NC4\kirby\src\Http\Environment.php(167): Kirby\Http\Environment::sanitize(Array) #3 C:\Kirby\NC4\kirby\src\Http\Environment.php(110): Kirby\Http\Environment->detect(Array, Array) #4 C:\Kirby\NC4\kirby\src\Cms\App.php(618): Kirby\Http\Environment->__construct() #5 C:\Kirby\NC4\kirby\src\Cms\AppErrors.php(68): Kirby\Cms\App->environment() #6 C:\Kirby\NC4\kirby\src\Cms\App.php(113): Kirby\Cms\App->handleErrors() #7 C:\Kirby\NC4\public_html\index.php(5): Kirby\Cms\App->__construct(Array) #8 C:\Kirby\NC4\kirby\router.php(15): require(‘C:\Kirby\NC4\pu…’) #9 {main} thrown in C:\Kirby\NC4\kirby\src\Http\Environment.php on line 904 ’