Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading pdo_mysql in php built-in server

Tags:

php

mysql

pdo

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)

like image 567
Cactux Avatar asked Dec 08 '22 09:12

Cactux


1 Answers

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

like image 73
Cactux Avatar answered Dec 11 '22 11:12

Cactux