Hello!
I am moving a site from HostGator to SiteGround. I am getting the
Fatal error : Uncaught Error: Class ‘Kirby’ not found in /home/customer/www/merylf.sg-host.com/public_html/index.php:5 Stack trace: #0 {main} thrown in /home/customer/www/merylf.sg-host.com/public_html/index.php on line 5
I can access the panel, but it will not allow me to save my registration info. mbstring is enabled. The temporary URL is http://merylf.sg-host.com/ and I have phpinfo.php there as well if that helps.
Thanks for any suggestions or help 
You did not copy all the files - namely kirby itself - or if you’re deploying with composer, forgot to do a composer install
1 Like
I can see Kirby folder there. Should I just upload the most up to date Kirby folder?
I checked and then reuploaded the entire Kirby folder. Still the same problem.
Hm, it’s really weird that the Panel is accessible while Kirby is not.
If you cannot save stuff, then that’s most likely an issue with write rights of the web server user.
1 Like
Would that be in the .htaccess? Or is it a file permission issue?
The strange thing is that this page, which I suppose is part of the installation does work: 4Sisters Rice Recipes, tips and tricks for cooking | 4Sisters Rice, and only the home page doesn’t (or is that a different website?). Could it be that there is something else interfering? Some routing, or another htaccess or whatever?
Or is that the old installation that the URL is still pointing to?
1 Like
That is weird 
Admittedly I’m not the most fluent with .htaccess files. Here’s the one there now:
# Apache block users from browsing folders without a default document
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
# Kirby .htaccess
# 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 /public_html
# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /
# Cachebuster plugin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d+)\.(js|css)$ $1.$3 [L]
# 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 text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
RewriteRule ^site/(.*) index.php [L]
# Enable authentication header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
# 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>
# 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>
The current URL is just a temporary one. Are you saying something inside the files is still pointing where I had it hosted before?
When I go to save files, it appears to work. But when I try to enter my registration info, it says Thanks for registering, then immediately goes back to saying this is an unregistered copy.
Ok, so it’s not the same URL that was used for the site hosted at HostGator?
The .htaccess file looks like the one that comes with Kirby apart from the first 4 lines.
1 Like
Correct. I was hosting it at aaron-jennings.com which I use to do development, then move the site to its new home. I wanted to use the temp URL in case something like this happened before giving it the actual domain it will get which is 4sistersrice.com
Usually, the issue is the other way round, the home page works and subpages and the Panel don’t because rewriting is not enabled or the .htaccess is ignored. But your subpages are working but the home page throws this error.
1 Like
I guess I didn’t think the domain name would bother me any because I linked everything using /blahblah/blah.
Any ideas?
The panel and everything is working fine except the index.php as far as I can see. And that the registration doesn’t seem to stick.
Could it be because I am in a public_html directory?
And the site is just a standard setup without any custom folder stuff etc?
I have no idea why the index.php cannot load the /kirby
folder for the home page but all other pages which go through the same index.php
1 Like
I did use the Zero One theme.
Here’s index.php
<?php
include __DIR__ . '/kirby/bootstrap.php';
$kirby = new Kirby([
'roots' => [
'index' => __DIR__,
'blueprints' => __DIR__ . '/site/theme/blueprints',
'collections' => __DIR__ . '/site/theme/collections',
'controllers' => __DIR__ . '/site/theme/controllers',
'models' => __DIR__ . '/site/theme/models',
'snippets' => __DIR__ . '/site/theme/snippets',
'templates' => __DIR__ . '/site/theme/templates'
]
]);
echo $kirby->render();
Then we should ask for the help of the theme developer, ping @mrfreedom
2 Likes
haha oh no! I bugged him so much 
I appreciate all of the help. this is my first Kirby project but the community is just fantastic. I am already getting my company on board with using Kirby more extensively!
1 Like
Could you please post the contents of the /site/config/config.php
file?
1 Like
It is interesting that phpinfo tells us, that the web server is Apache but the Header says it is nginx. I guess there is some misconfiguration and/or an intervening proxy. Note the line X-Proxy-Cache: HIT in the attached screenshot:
1 Like
<?php
return [
'smartypants' => true,
'date' => [
'handler' => 'strftime'
],
'languages' => true,
// Autoresize
'medienbaecker.autoresize.maxWidth' => 1200,
// Cachebuster
'schnti.cachebuster.active' => true,
// Commentions
'sgkirby.commentions.templatesWithComments' => ['article'],
'sgkirby.commentions.templatesWithWebmentions' => [''],
'sgkirby.commentions.hideforms' => false, /* Comment form hide buttom, if true */
'sgkirby.commentions.expand' => true, /* Webmention form hide buttom, if true */
'sgkirby.commentions.allowlinks' => true, /* Allow links in comments, if true */
'sgkirby.commentions.autolinks' => true, /* Automatically recognize URLs in comments and turn them into links. Has no effect, if allowlinks is false. */
'sgkirby.commentions.commentfields' => [
'name' => true, // include name field and mark as required
'email'=> true, // include email as optional field
'website', // include optional website field
],
'sgkirby.commentions.secret' => '<YOUR-SECRET>', // A valid secret key must be at least 10 characters long and may NOT include any of the following: & % # + nor a space sign .
// Srcset
'thumbs' => [
'quality' => '85',
'srcsets' => [
'default' => [
'800w' => [
'width' => 800
],
'1024w' => [
'width' => 1024
],
'1920w' => [
'width' => 1920
],
],
]
],
// Robots
'bnomei.robots-txt.sitemap' => 'sitemap.xml',
'bnomei.robots-txt.groups' => [ // array or callback
'*' => [ // user-agent
'disallow' => [
'/kirby/',
'/site/',
],
'allow' => [
'/media/',
]
]
],
'email' => [
'transport' => [
'type' => 'smtp',
'host' => 'smtp.server.com',
'port' => 465,
'security' => true,
'auth' => true,
'username' => 'XXXXX',
'password' => 'XXXXX',
]
],
// Support for language detect option
'routes' => [
[
'pattern' => '/',
'action' => function () {
$session = kirby()->session();
if ($session->get('languages.detect', false) === false && option('languages.detect') === true) {
$session->set('languages.detect', true);
return kirby()
->response()
->redirect(kirby()->detectedLanguage()->url());
}
return page();
}
]
]
];