Error loading pdo_mysql in embedded php server

I want to run the embedded php server (works $ php -S localhost:8888) with the PDO extension. But when I enter this command into the 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, he says that PDO class not found)

Same thing when I run only $ php. But when I start apache2 server, everything looks good (PDO extension works).

And the file /usr/lib/php5/20121212/pdo_mysql.soexists.

Thank you for your responses!

(running php 5 on ubuntu)

+4
source share
1 answer

I finally decided by reinstalling php:

  • Remove php with the cleanup option:

    sudo apt-get --purge remove php5-common

  • And install again:

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

: PHP5..Unable

+11

Source: https://habr.com/ru/post/1525808/


All Articles