0

I'm developing web-service using Symfony2 framework. I want to use pdo_mysql.

enter image description here

As you can see, I've installed PDO and pdo_mysql. But I get a next error when I try to use ORM in my project:

enter image description here

when I used doctrine from command line, it works. What is this issue?

enter image description here

P.S. When I try to use PDO in flat php code (eg, create index.php in htdocs with content

 <?php
    print_r(PDO::getAvailableDrivers());

it doesn't work (not response from server, but apache error log doesn't contain anything about php error)). But when I try using PDO in command line (eg,

php -r "eval(print_r(PDO::getAvailableDrivers()));

I get a correct array consisting of one mysql_pdo.

1
  • so.. I've solved this problem by running php built-in server instead apache. Can anyone explain me, why does it work? Commented Mar 15, 2014 at 4:05

1 Answer 1

1

If you're using WAMP or something similar, IMO, your CLI environment have the PDO extension but not the apache one. PHP does not use the same configuration for these two environments...

If you want to know what is really loaded, use phpinfo() in your different environments.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.