entomb / slim-json-api

Slim extension to implement fast JSON API's
MIT License
268 stars 50 forks source link

ERROR: could not find driver #4

Closed markopavlovic closed 10 years ago

markopavlovic commented 11 years ago

I added it to composer to my current slim app, added the Middleware and the view, but now I get this error returned?

{"error":true,"msg":"ERROR: could not find driver","status":500}

What gone wrong? Thanks in advance

entomb commented 11 years ago

Doesn't look like an error from this module,

"could not find driver" and the 500 code sugest that something is throwing and exeption. Are you using a DB connection? could be something related to the database driver.

can you share your composer file require contents? maybe I can help

markopavlovic commented 11 years ago

Thank you for trying to help! Yes I am using a db connection and ORM/idiorm as layer, but slim itself,nither ORM exceptions, do not report me this kind of error on my connection, this only occurs when I try to add slimJsonApi in middleware and view. I will try now to switch of debug and highup error reporting to see if something pops out

Here is my composer require

"require": { "slim/slim": "2.*", "entomb/slim-json-api": "*", "j4mie/idiorm": "*", "bshaffer/oauth2-server-php": "*", "facebook/php-sdk": "dev-master", "themattharris/tmhoauth": "*" }

entomb commented 11 years ago

Your app trowing this 500 I can understand, the slim-json-api midlewares are very strict and will stop and throw any and every error, so this error might have been there before but it wasn't being outputted.

The part that is really strange is: making a grep on all the files on those packages i could not find the could not find driver exception, or anything related. Might be something you wrote somewhere? this is clearly an exception being thrown so it must be easy to find.

can you also try running your app with the middleware turned off, and using $slim->config('debug', true); to see where is the exception being thrown?

entomb commented 11 years ago

ah-ah! I just found out this is a PDO (used by idiorm) exception and that's why we couldn't find it.

theres a lot of people around the net with the same problem, check out some of these first results https://www.google.pt/search?&q=pdo+could+not+find+driver

markopavlovic commented 11 years ago

Yes, seems like PDO throws a false warning error becouse he doesn't detect the module in php.ini like extension=php_pdo_mysql.dll, however this doesn't couse any problems in general but still throws a silent error. There is a simple workaround for this, we can even put it in this repository or link it on readme, what do you say?

entomb commented 11 years ago

Feel free to pull request a note on the readme!

On Thu, Oct 10, 2013 at 1:38 PM, Marko Pavlovic notifications@github.comwrote:

Yes, seems like PDO throws a false warning error becouse he doesn't detect the module in native php like extension=php_pdo_mysql.dll, however this doesn't couse any problems in general but still throws a silent error. There is a simple workaround for this, we can even put it in this repository or link it on readme, what do you say?

— Reply to this email directly or view it on GitHubhttps://github.com/entomb/slim-json-api/issues/4#issuecomment-26049740 .

"best ideas often come from the worst minds"

the . entomb