4

I want to run php's built-in server (running by $ php -S localhost:8888) with PDO extension. But when I type this command into terminal it gives me:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/pdo_mysql.so' - /usr/lib/php5/20121212/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0

(And when I try to use it it says that PDO class not found)

The same is when I run just $ php. But when I start apache2 server everything looks good (the PDO extension is working).

And the file /usr/lib/php5/20121212/pdo_mysql.so exists.

Thanks for your answers!

(running php 5 on ubuntu)

Ian Kemp
  • 28,293
  • 19
  • 112
  • 138
Cactux
  • 868
  • 1
  • 9
  • 19

1 Answers1

15

I've finally solved by reinstalling php:

  1. Uninstall php with purge parameter:

    sudo apt-get --purge remove php5-common

  2. And install again:

    sudo apt-get install php5 php5-mysql php5-curl etc...

Source: Error In PHP5 ..Unable to load dynamic library

Community
  • 1
  • 1
Cactux
  • 868
  • 1
  • 9
  • 19