<p>This project was missing the <code>craft/app/etc/db/</code>directory and all files within that directory (my .gitignore file had meant to ignore the project root db directory, but caught all directories named 'db'). Removing 'db' from my .gitignore and re-pushing to my server solved this error.</p>

CC BY-SA 3.0
2017-03-14T21:50:22.307Z
2017-03-14T21:50:22.307Z
dace
<p>I'm getting a 500 error when trying to visit my page. Was able to track it down to this error in the logs, but can't seem to get it fixed. Updated the craft/app folder with the latest Craft version, but still no luck. </p>

<p>From my phperrors.log</p>

<pre><code>[14-Mar-2017 17:56:34 UTC] PHP Fatal error:  Uncaught Error: Class 'Craft\DbConnection' not found in /var/www/site/craft/app/etc/behaviors/AppBehavior.php:849
</code></pre>

CC BY-SA 3.0
2017-03-14T20:12:28.300Z
Does `craft/app/etc/db/DbConnection.php` exist on the file system?
Brad Bell
CC BY-SA 3.0
2017-03-14T20:35:10.727Z
@BradBell Nope, just noticed that. Should that come with Craft or does it require additional manual setup?
dace
CC BY-SA 3.0
2017-03-14T20:51:22.430Z
@BradBell Yeah, just realized that directory is not getting pushed up with the others for some reason. It's on my machine locally (not being gitignored). Not sure what the issue is.
dace
CC BY-SA 3.0
2017-03-14T20:54:26.917Z
I'd have guessed gitignore, but maybe whatever deployment services you're using has their own blacklist mechanism.
Brad Bell
CC BY-SA 3.0
2017-03-14T21:34:24.060Z
@BradBell Thanks Brad. It actually was a db in the gitignore. It was meant to hide a db directory in the project root, but also ended up hiding the db folder that I needed. This solved this class error. Appreciate it.
dace
CC BY-SA 3.0
2017-03-14T21:35:48.997Z
No worries... can you add that as an official answer in case someone else runs into it in the future?
Brad Bell
<error-message>
PHP Fatal error: Uncaught Error: Class 'Craft\DbConnection' not found
# PHP Fatal error: Uncaught Error: Class 'Craft\DbConnection' not found

(Asked by: username_0 on 2017-03-14)

I'm getting a 500 error when trying to visit my page. Was able to track it down to this error in the logs, but can't seem to get it fixed. Updated the craft/app folder with the latest Craft version, but still no luck. 
From my phperrors.log
[14-Mar-2017 17:56:34 UTC] PHP Fatal error:  Uncaught Error: Class 'Craft\DbConnection' not found in /var/www/site/craft/app/etc/behaviors/AppBehavior.php:849

**Tags:** error-message

> **Comments:**
> **username_1**: Does `craft/app/etc/db/DbConnection.php` exist on the file system?  
> **username_0**: @BradBell Nope, just noticed that. Should that come with Craft or does it require additional manual setup?  
> **username_0**: @BradBell Yeah, just realized that directory is not getting pushed up with the others for some reason. It's on my machine locally (not being gitignored). Not sure what the issue is.  
> **username_1**: I'd have guessed gitignore, but maybe whatever deployment services you're using has their own blacklist mechanism.  
> **username_0**: @BradBell Thanks Brad. It actually was a db in the gitignore. It was meant to hide a db directory in the project root, but also ended up hiding the db folder that I needed. This solved this class error. Appreciate it.  
> **username_1**: No worries... can you add that as an official answer in case someone else runs into it in the future?  

---

## 1 answers

### Answer by username_0 on 2017-03-14. Score: 3 | Accepted answer

This project was missing the `craft/app/etc/db/`directory and all files within that directory (my .gitignore file had meant to ignore the project root db directory, but caught all directories named 'db'). Removing 'db' from my .gitignore and re-pushing to my server solved this error.


---

