0

I’m kinda new to Kirby. I’ve been trying to launch a website with heroku, have manipulated few things and wasn’t able to. I think I understood having a server issue since I kept getting a “frobidden access”, so I tried to install Apache Server and I think it modified my app root. Now I am stuck with this error and I can’t even open my localhost anymore. Could someone help me with this ?

Fatal error: Uncaught Error: Class "Kirby" not found in /Users/hannahbroucaret/Desktop/website_starterkit/website-starterkit/www/index.php:6 Stack trace: #0 /Users/hannahbroucaret/Desktop/website_starterkit/website-starterkit/www/kirby/router.php(14): require() #1 {main} thrown in /Users/hannahbroucaret/Desktop/website_starterkit/website-starterkit/www/index.php on line 6

Thank you

I updated my .htaccess

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L,NE]


# 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 enviroments 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 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>

<IfModule dir_module>
DirectoryIndex index.html index.php
</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>

Also my procfile

web: vendor/bin/heroku-php-apache2

And I ran these commands

 8361  brew update  
 8362  brew install apache
 8363  brew install apache2
 8364  sudo apachectl start
 8365  sudo nano /etc/apache2/apache2.conf
 8366  cd /etc/apache2/apache2.conf
 8367  cd ..
 8368  ls
 8369  cd ..
 8370  cd /etc/apache2/apache2.conf
 8371  ls
 8372  cd ..
 8373  ls
 8374  cd hannahbroucaret
 8375  cd Library
 8376  cd ..
 8377  cd Desktop
 8378  cd website_starterkit/website-starterkit
 8379  cd apache2.conf
 8380  sudo /etc/apache2/apache2.conf
 8381  sudo nano /etc/apache2/apache2.conf
 8382  sudo \nsudo: systemctl: command not found\n
 8383  sudo apachectl start 
 8384  npm run start
 8385* composer install
 8386  git undo
 8387  sudo apachectl -k stop
 8388  npm run start
 8389  PHP Fatal error:  Uncaught Error: Class "Kirby" not found in /
 8390  sudo apachectl stop  
 8391  history
 8392  history -d 8390
 8393  history
 8394  history -d 8361
 8395  history
 8396  history -d 8362
 8397  help history
 8398  history unset 8362
 8399  npm run start
 8400  history
 8401  history destroy 8361
 8402  history -destroy 8361
 8403  history
 8404  brew unsinstall apache2
 8405  brew uninstall apache2

____UPDATE

Now I have this files architecture enter image description here

And I get this error : PHP Warning: Unknown: Failed to open stream: No such file or directory in Unknown on line 0 [server] [Fri Nov 18 13:21:34 2022] PHP Fatal error: Failed opening required 'www/kirby/router.php' (include_path='.:/usr/local/Cellar/php/8.1.12/share/php/pear') in Unknown on line 0

hbrouc
  • 21
  • 3

0 Answers0