PHP error on fresh install of BookStack #2387

Closed
opened 2026-02-05 03:54:50 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Jenko91 on GitHub (Sep 11, 2021).

Describe the bug
After a clean install I get below PHP error:
Fatal error: Uncaught Error: Class 'BookStack\Application' not found in /home/user/BookStack/bootstrap/app.php:14 Stack trace: #0 /home/user/public_html/knjige/index.php(39): require_once() #1 {main} thrown in /home/user/BookStack/bootstrap/app.php on line 14

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to http://bhakte.si/knjige/
  2. See error

Expected behavior
Working appliaction.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v21.08.2
  • PHP Version: 7.3
  • Hosting Method (Nginx/Apache/Docker): cPanel + CloudlinuxOS with LiteSpeed webserver

Additional context
I've installed the BookStack via instructions that are available on the link below:

The installation from 16th point onwards is a bit different since the below PHP line is not in index.php:
require DIR.'/../bootstrap/init.php';
This step was consequently skipped.

The BookStack files are located in /home/user/BookStack/ and the website (files from public folder) are located in /home/user/public_html/knjige.

All the permissions are correct.

I've tried installing the application by the same method also on cPanel + Cloudlinux with Apache webserver but I get the same PHP error.

Kind regards,
Anze

Originally created by @Jenko91 on GitHub (Sep 11, 2021). **Describe the bug** After a clean install I get below PHP error: _Fatal error: Uncaught Error: Class 'BookStack\Application' not found in /home/user/BookStack/bootstrap/app.php:14 Stack trace: #0 /home/user/public_html/knjige/index.php(39): require_once() #1 {main} thrown in /home/user/BookStack/bootstrap/app.php on line 14_ **Steps To Reproduce** Steps to reproduce the behavior: 1. Go to http://bhakte.si/knjige/ 2. See error **Expected behavior** Working appliaction. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v21.08.2 - PHP Version: 7.3 - Hosting Method (Nginx/Apache/Docker): cPanel + CloudlinuxOS with LiteSpeed webserver **Additional context** I've installed the BookStack via instructions that are available on the link below: - https://www.warpconduit.net/2019/11/16/installing-bookstack-wiki-on-cpanel-shared-hosting/ The installation from 16th point onwards is a bit different since the below PHP line is not in index.php: _require __DIR__.'/../bootstrap/init.php';_ This step was consequently skipped. The BookStack files are located in _/home/user/BookStack/_ and the website (files from **public** folder) are located in _/home/user/public_html/knjige_. All the permissions are correct. I've tried installing the application by the same method also on cPanel + Cloudlinux with Apache webserver but I get the same PHP error. Kind regards, Anze
Author
Owner

@ssddanbrown commented on GitHub (Sep 12, 2021):

Hi @Jenko91,
We don't support this level of restricted shared hosting and I cannot advise following the instructions listed as we can't really support or recommend making changes to the core files, as it could be easy to end up with a insecure setup in addition to one that's hard to maintain/update in the future.

@ssddanbrown commented on GitHub (Sep 12, 2021): Hi @Jenko91, We don't support this level of restricted shared hosting and I cannot advise following the instructions listed as we can't really support or recommend making changes to the core files, as it could be easy to end up with a insecure setup in addition to one that's hard to maintain/update in the future.
Author
Owner

@Jenko91 commented on GitHub (Sep 12, 2021):

Hello @ssddanbrown,

thank you for your reply.

Kind regards,
Anze

@Jenko91 commented on GitHub (Sep 12, 2021): Hello @ssddanbrown, thank you for your reply. Kind regards, Anze
Author
Owner

@ssddanbrown commented on GitHub (Sep 12, 2021):

No worries, Will therefore close this off.

@ssddanbrown commented on GitHub (Sep 12, 2021): No worries, Will therefore close this off.
Author
Owner

@treverehrfurth commented on GitHub (Mar 25, 2023):

@Jenko91 I see your site is up and running, how did you end up doing it?
I also followed that tutorial and got all the way to step 16 and am stuck...

@treverehrfurth commented on GitHub (Mar 25, 2023): @Jenko91 I see your site is up and running, how did you end up doing it? I also followed that tutorial and got all the way to step 16 and am stuck...
Author
Owner

@Jenko91 commented on GitHub (Mar 30, 2023):

Hello @Pray4Tre,

sorry for the late reply.

Sadly I cannot remember completely what steps were taken to solve the issue.
I believe I had to work with the ".htaccess" rules in the website file section (./public_html/knjige/.htaccess).

If it helps, I'm pasting the full ".htaccess" content below:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On
    RewriteBase /path_to_website_files/
    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Please try with this.

Also check the paths in "./path/to/website/files/index.php" if they are setup correctly.

Kind regards!

@Jenko91 commented on GitHub (Mar 30, 2023): Hello @Pray4Tre, sorry for the late reply. Sadly I cannot remember completely what steps were taken to solve the issue. I believe I had to work with the ".htaccess" rules in the website file section (./public_html/knjige/.htaccess). If it helps, I'm pasting the full ".htaccess" content below: ``` <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On RewriteBase /path_to_website_files/ # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> ``` Please try with this. Also check the paths in "./path/to/website/files/index.php" if they are setup correctly. Kind regards!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2387