Installation Help #188

Closed
opened 2026-02-04 17:30:25 +03:00 by OVERLORD · 26 comments
Owner

Originally created by @dvnrsn on GitHub (Oct 25, 2016).

Hey I'm a little new to development and linux. I've followed the installation docs as best as I could follow (except for the email because I'm a little confused how that works) and I am just getting text when I load localhost. / / |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provi etc.

I'm also getting error [PDOException]
could not find driver
on artisan migrate

My phpinfo is working and I have a database and user created. Where am I going wrong?

Originally created by @dvnrsn on GitHub (Oct 25, 2016). Hey I'm a little new to development and linux. I've followed the installation docs as best as I could follow (except for the email because I'm a little confused how that works) and I am just getting text when I load localhost. _/ /_ |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provi etc. I'm also getting error [PDOException] could not find driver on artisan migrate My phpinfo is working and I have a database and user created. Where am I going wrong?
OVERLORD added the 🐕 Support label 2026-02-04 17:30:25 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 25, 2016):

Hi @devin42r,
It looks like your webserver is not parsing PHP files and is simply serving them as text (Since what you provided is the content of the main php file).

What webserver are you using? Apache or Nginx or something else?

Also, What variant and version of linux are you using?

@ssddanbrown commented on GitHub (Oct 25, 2016): Hi @devin42r, It looks like your webserver is not parsing PHP files and is simply serving them as text (Since what you provided is the content of the main php file). What webserver are you using? Apache or Nginx or something else? Also, What variant and version of linux are you using?
Author
Owner

@dvnrsn commented on GitHub (Oct 25, 2016):

Hey Dan thanks for the quick response. I am using apache2 on kubuntu 16. The info.php file I have created to render phpinfo() (in the same directory) is displaying desired php config info. So I thought it might be some issue with the permission to bootstrap? But everything is owned by www-data..

@dvnrsn commented on GitHub (Oct 25, 2016): Hey Dan thanks for the quick response. I am using apache2 on kubuntu 16. The info.php file I have created to render phpinfo() (in the same directory) is displaying desired php config info. So I thought it might be some issue with the permission to bootstrap? But everything is owned by www-data..
Author
Owner

@dvnrsn commented on GitHub (Oct 25, 2016):

hmm, except for info.php which is owned by root. Is there some way that www-data would not be able to utilize php?

drwxrwxr-x 8 www-data root 4096 Oct 24 22:29 ./
drwxrwxr-x 13 www-data root 4096 Oct 24 18:42 ../
drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 build/
drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 css/
drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 fonts/
drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 js/
drwxrwxr-x 8 www-data root 4096 Oct 20 21:22 libs/
drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 uploads/
-rw-rw-r-- 1 www-data root 10933 Oct 20 21:22 favicon.ico
-rw-rw-r-- 1 www-data root 412 Oct 20 21:22 .htaccess
-rw-rw-r-- 1 www-data root 1819 Oct 24 22:29 index.php
-rw-r--r-- 1 root root 20 Oct 24 20:02 info.php
-rw-rw-r-- 1 www-data root 11098 Oct 20 21:22 loading.gif
-rw-rw-r-- 1 www-data root 4682 Oct 20 21:22 logo.png
-rw-rw-r-- 1 www-data root 24 Oct 20 21:22 robots.txt
-rw-rw-r-- 1 www-data root 7405 Oct 20 21:22 user_avatar.png
-rw-rw-r-- 1 www-data root 6580 Oct 20 21:22 ZeroClipboard.swf

@dvnrsn commented on GitHub (Oct 25, 2016): hmm, except for info.php which is owned by root. Is there some way that www-data would not be able to utilize php? drwxrwxr-x 8 www-data root 4096 Oct 24 22:29 ./ drwxrwxr-x 13 www-data root 4096 Oct 24 18:42 ../ drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 build/ drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 css/ drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 fonts/ drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 js/ drwxrwxr-x 8 www-data root 4096 Oct 20 21:22 libs/ drwxrwxr-x 2 www-data root 4096 Oct 20 21:22 uploads/ -rw-rw-r-- 1 www-data root 10933 Oct 20 21:22 favicon.ico -rw-rw-r-- 1 www-data root 412 Oct 20 21:22 .htaccess -rw-rw-r-- 1 www-data root 1819 Oct 24 22:29 index.php -rw-r--r-- 1 root root 20 Oct 24 20:02 info.php -rw-rw-r-- 1 www-data root 11098 Oct 20 21:22 loading.gif -rw-rw-r-- 1 www-data root 4682 Oct 20 21:22 logo.png -rw-rw-r-- 1 www-data root 24 Oct 20 21:22 robots.txt -rw-rw-r-- 1 www-data root 7405 Oct 20 21:22 user_avatar.png -rw-rw-r-- 1 www-data root 6580 Oct 20 21:22 ZeroClipboard.swf
Author
Owner

@ssddanbrown commented on GitHub (Oct 25, 2016):

@devin42r Does anything load if you go to http://localhost/index.php ?

Just to ensure it's the apache config that's the issue you can go to the folder containing BookStack in the terminal and run php artisan serve which will run a simple php server accessible at http://localhost:8000. See if that works. I'd imagine you'd still have errors since the database did not migrate but hopefully you'll be further along.

@ssddanbrown commented on GitHub (Oct 25, 2016): @devin42r Does anything load if you go to `http://localhost/index.php` ? Just to ensure it's the apache config that's the issue you can go to the folder containing BookStack in the terminal and run `php artisan serve` which will run a simple php server accessible at `http://localhost:8000`. See if that works. I'd imagine you'd still have errors since the database did not migrate but hopefully you'll be further along.
Author
Owner

@dvnrsn commented on GitHub (Oct 25, 2016):

Hmm, a blank page. Just empty html, head and body tags. Now that is all I'm getting regardless of whether I use localhost or 127.0.0.1 (with or without index.php appended).

When I kick up the phpserver it is giving me the same on 8000.

@dvnrsn commented on GitHub (Oct 25, 2016): Hmm, a blank page. Just empty html, head and body tags. Now that is all I'm getting regardless of whether I use localhost or 127.0.0.1 (with or without index.php appended). When I kick up the phpserver it is giving me the same on 8000.
Author
Owner

@lommes commented on GitHub (Oct 26, 2016):

What's your PHP version? How do the permissions look in the BookStack base directory? Laravel sometimes fails when it cannot access/write logs. So if the base directory (or the storage subfolder) is only writeable for root, this might be the problem.

@lommes commented on GitHub (Oct 26, 2016): What's your PHP version? How do the permissions look in the BookStack base directory? Laravel sometimes fails when it cannot access/write logs. So if the base directory (or the storage subfolder) is only writeable for root, this might be the problem.
Author
Owner

@dvnrsn commented on GitHub (Oct 27, 2016):

php -v
PHP 7.0.12-1 (cli) ( NTS )

@dvnrsn commented on GitHub (Oct 27, 2016): php -v PHP 7.0.12-1 (cli) ( NTS )
Author
Owner

@dvnrsn commented on GitHub (Oct 27, 2016):

drwxr-xr-x 4 root root 4096 Oct 24 19:37 .
drwxr-xr-x 15 root root 4096 Oct 24 19:03 ..
drwxrwxr-x 13 www-data root 4096 Oct 24 18:42 BookStack
drwxr-xr-x 2 root root 4096 Oct 24 20:03 html

@dvnrsn commented on GitHub (Oct 27, 2016): drwxr-xr-x 4 root root 4096 Oct 24 19:37 . drwxr-xr-x 15 root root 4096 Oct 24 19:03 .. drwxrwxr-x 13 www-data root 4096 Oct 24 18:42 BookStack drwxr-xr-x 2 root root 4096 Oct 24 20:03 html
Author
Owner

@dvnrsn commented on GitHub (Oct 27, 2016):

My base directory is a little further up ^^

@dvnrsn commented on GitHub (Oct 27, 2016): My base directory is a little further up ^^
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

@devin42r Could you look for any clues in the Apache logs?

Should be an error log at /var/log/apache2/error.log or a similar location.

@ssddanbrown commented on GitHub (Oct 28, 2016): @devin42r Could you look for any clues in the Apache logs? Should be an error log at /var/log/apache2/error.log or a similar location.
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

PHP Parse error: syntax error, unexpected 'echo' (T_ECHO) in /var/www/BookStack/public/index.php on line 3

Good call Dan, I don't know why I didn't check the logs. I had inserted a line asdfasdf and on the next line echo "asdfasdf"; trying to test earlier and forgotten. I removed both lines (echo works if I just leave it), but now I'm facing this screen

Whoops, looks like something went wrong.

Nothin in apache logs for this. I doublechecked the write permissions on respective files, re-ran, php artisan key:generate, doublechecked database user settings (and logged in from terminal), mail settings are still default, and tried to run php artisan migrate (still same error of [PDOException] could not find driver).

@dvnrsn commented on GitHub (Oct 28, 2016): PHP Parse error: syntax error, unexpected 'echo' (T_ECHO) in /var/www/BookStack/public/index.php on line 3 Good call Dan, I don't know why I didn't check the logs. I had inserted a line asdfasdf and on the next line echo "asdfasdf"; trying to test earlier and forgotten. I removed both lines (echo works if I just leave it), but now I'm facing this screen Whoops, looks like something went wrong. Nothin in apache logs for this. I doublechecked the write permissions on respective files, re-ran, php artisan key:generate, doublechecked database user settings (and logged in from terminal), mail settings are still default, and tried to run php artisan migrate (still same error of [PDOException] could not find driver).
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

Whoops, looks like something went wrong.

This is a good line to see. The browser request is now reaching the application. You can turn on debugging or check the logs for more information. Details to do this can be found here:
https://www.bookstackapp.com/docs/admin/debugging

@ssddanbrown commented on GitHub (Oct 28, 2016): > Whoops, looks like something went wrong. This is a good line to see. The browser request is now reaching the application. You can turn on debugging or check the logs for more information. Details to do this can be found here: https://www.bookstackapp.com/docs/admin/debugging
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

Also, Ensure you have the php7.0-mysql package installed (sudo apt install php7.0-mysql)

@ssddanbrown commented on GitHub (Oct 28, 2016): Also, Ensure you have the `php7.0-mysql` package installed (`sudo apt install php7.0-mysql`)
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

Awesome, I was trying all sorts of installs on mysql and sqlite as recommended on stack but the one you just provided got me another step further. Now I'm hitting the following:

Base table or view not found: 1146 Table 'bookstack.settings' doesn't exist (SQL: select * from settings where setting_key = app-public limit 1)

I don't understand. Am I supposed to configure some settings in mysql? I created my db user, db and password but is there something else?

@dvnrsn commented on GitHub (Oct 28, 2016): Awesome, I was trying all sorts of installs on mysql and sqlite as recommended on stack but the one you just provided got me another step further. Now I'm hitting the following: Base table or view not found: 1146 Table 'bookstack.settings' doesn't exist (SQL: select \* from `settings` where `setting_key` = app-public limit 1) I don't understand. Am I supposed to configure some settings in mysql? I created my db user, db and password but is there something else?
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

No, I forgot I needed to actually finish the php artisan migrate...now it's taking me to /login and giving me

The requested URL /login was not found on this server.

No apache logs hmmm

@dvnrsn commented on GitHub (Oct 28, 2016): No, I forgot I needed to actually finish the php artisan migrate...now it's taking me to /login and giving me The requested URL /login was not found on this server. No apache logs hmmm
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

Okay, Now it looks like an issue in the apache configuration. What is the URL you are try to access BookStack at? is it something like http://example.com/ or are you accessing via a sub-directory like http://example.com/BookStack/?

If you have set up an apache virtual host for BookStack can you paste the config here? If not have you made any changes to the apache configuration while installing BookStack?

@ssddanbrown commented on GitHub (Oct 28, 2016): Okay, Now it looks like an issue in the apache configuration. What is the URL you are try to access BookStack at? is it something like `http://example.com/` or are you accessing via a sub-directory like `http://example.com/BookStack/`? If you have set up an apache virtual host for BookStack can you paste the config here? If not have you made any changes to the apache configuration while installing BookStack?
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

I have been accessing it at localhost or 127.0...

Hmm, dang I did make some changes earlier but can't remember. Maybe the allowoverride. I'll search for what the default is and try to bring it back..

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Allow from all
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/BookStack>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
        Require all granted
</Directory>

I think I invented that last Directory as I was trying to get things working. That shouldn't be there if I understand apache...

@dvnrsn commented on GitHub (Oct 28, 2016): I have been accessing it at localhost or 127.0... Hmm, dang I did make some changes earlier but can't remember. Maybe the allowoverride. I'll search for what the default is and try to bring it back.. ``` html <Directory /> Options FollowSymLinks AllowOverride None Allow from all Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/BookStack> Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from all Require all granted </Directory> ``` I think I invented that last Directory as I was trying to get things working. That shouldn't be there if I understand apache...
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

sites-available/000-default.conf does have
DocumentRoot /var/www/BookStack/public

@dvnrsn commented on GitHub (Oct 28, 2016): sites-available/000-default.conf does have DocumentRoot /var/www/BookStack/public
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

Interestingly, http://127.0.0.1/index.php/login brings me to the correct page. I can't navigate anywhere from there. Similar thing is happening in nginx on my amazon server (except I can't even get index.php/login to load).

@dvnrsn commented on GitHub (Oct 28, 2016): Interestingly, http://127.0.0.1/index.php/login brings me to the correct page. I can't navigate anywhere from there. Similar thing is happening in nginx on my amazon server (except I can't even get index.php/login to load).
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

On your apache instance, Have you ran the command sudo a2enmod rewrite?

@ssddanbrown commented on GitHub (Oct 28, 2016): On your apache instance, Have you ran the command `sudo a2enmod rewrite`?
Author
Owner

@dvnrsn commented on GitHub (Oct 28, 2016):

Awesome that did it! Any idea how to do the same on nginx? From what I understand it happens with that line you guys included in the installation try_files $uri...index.php... Here is my relevant code from nginx.conf

`server {
listen 81 default_server;
listen [::]:81 default_server;
server_name localhost;
root /usr/share/nginx/bookstack/BookStack/public;

    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location ~ / {try_files $uri $uri/ /index.php?$args;}`
@dvnrsn commented on GitHub (Oct 28, 2016): Awesome that did it! Any idea how to do the same on nginx? From what I understand it happens with that line you guys included in the installation try_files $uri...index.php... Here is my relevant code from nginx.conf `server { listen 81 default_server; listen [::]:81 default_server; server_name localhost; root /usr/share/nginx/bookstack/BookStack/public; ``` # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location ~ / {try_files $uri $uri/ /index.php?$args;}` ```
Author
Owner

@ssddanbrown commented on GitHub (Oct 28, 2016):

Awesome that did it!

🎉

Any idea how to do the same on nginx?

No obvious issues from the config you pasted. Is PHP definately all working okay via nginx?

Here's the default config I put together for the default ubuntu 16.04 install script:
https://github.com/BookStackApp/devops/blob/master/config/nginx

You can compare your config with that one. It's made for ubuntu 16.04 so for other systems it may not be correct. You'll have to ensure you have the php7.0-fpm package installed on your system.

@ssddanbrown commented on GitHub (Oct 28, 2016): > Awesome that did it! :tada: > Any idea how to do the same on nginx? No obvious issues from the config you pasted. Is PHP definately all working okay via nginx? Here's the default config I put together for the default ubuntu 16.04 install script: https://github.com/BookStackApp/devops/blob/master/config/nginx You can compare your config with that one. It's made for ubuntu 16.04 so for other systems it may not be correct. You'll have to ensure you have the `php7.0-fpm` package installed on your system.
Author
Owner

@ssddanbrown commented on GitHub (Jan 30, 2017):

Closing due to lack of response. Feel free to still respond to the above and I'll re-open this.

@ssddanbrown commented on GitHub (Jan 30, 2017): Closing due to lack of response. Feel free to still respond to the above and I'll re-open this.
Author
Owner

@bydox commented on GitHub (Feb 15, 2017):

Hi ! I encountered the same issue (blank login page after installation) on my Debian 8 installation. I eventually found the answer. It was a permission issue. What I did is the following, while in the app folder :

php artisan cache:clear
chmod -R 777 storage
chmod -R 777 bootstrap/cache
chmod -R 777 public/uploads
composer dump-autoload

(Source)

I'll tweak the permissions to not let the folders completely opened, but I got to make BookStack to work. ;)

Hope it helps !

@bydox commented on GitHub (Feb 15, 2017): Hi ! I encountered the same issue (blank login page after installation) on my Debian 8 installation. I eventually found the answer. It was a permission issue. What I did is the following, while in the app folder : `php artisan cache:clear` `chmod -R 777 storage` `chmod -R 777 bootstrap/cache` `chmod -R 777 public/uploads` `composer dump-autoload` [(Source)](http://stackoverflow.com/questions/23540083/failed-to-open-stream-permission-denied-error-laravel) I'll tweak the permissions to not let the folders completely opened, but I got to make BookStack to work. ;) Hope it helps !
Author
Owner

@dvnrsn commented on GitHub (Feb 15, 2017):

@bydox thanks for posting. @ssddanbrown my apologies for not getting back. I abandoned the nginx because I was simply doing that out of curiosity. Recently I just spun up bookstack on an ec2 server, however, and might need to throw up an issue for that for future ec2 users. I had to open permissions to 777 as well there. Need to figure out who is in apache group and why ec2-user was having issues even as owner and group...

@dvnrsn commented on GitHub (Feb 15, 2017): @bydox thanks for posting. @ssddanbrown my apologies for not getting back. I abandoned the nginx because I was simply doing that out of curiosity. Recently I just spun up bookstack on an ec2 server, however, and might need to throw up an issue for that for future ec2 users. I had to open permissions to 777 as well there. Need to figure out who is in apache group and why ec2-user was having issues even as owner and group...
Author
Owner

@A9G-Data-Droid commented on GitHub (Feb 7, 2023):

chmod -R 777 storage
chmod -R 777 bootstrap/cache
chmod -R 777 public/uploads

It should be noted that you don't want to allow everyone write, which is what 777 does. If the user and group are correctly set to the httpd user www-data or apache then you permissions don't have to be set wide open.

EXAMPLE:

sudo chown www-data:www-data -R bootstrap/cache public/uploads storage 
sudo chmod -R 755 bootstrap/cache public/uploads storage
@A9G-Data-Droid commented on GitHub (Feb 7, 2023): > `chmod -R 777 storage` > `chmod -R 777 bootstrap/cache` > `chmod -R 777 public/uploads` It should be noted that you don't want to allow everyone write, which is what 777 does. If the user and group are correctly set to the httpd user `www-data` or `apache` then you permissions don't have to be set wide open. EXAMPLE: ``` sudo chown www-data:www-data -R bootstrap/cache public/uploads storage sudo chmod -R 755 bootstrap/cache public/uploads storage ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#188