When I use YII2 to build a website, I often get the following warning when I open the website:
PHP warning:php startup:unable to load Dynamic Library '/usr/lib/php5/20121212/pdo_mysql.so '-/usr/lib/php5/20121212/p do_mysql.so:undefined Symbol:pdo_parse_params in Unknown on line 0
Workaround:
Remove and purge the Php5-common package. That is, remove and merge the Php5-common installation package.
However, when you do this, the other packages will be removed, so to remove the Php5-common, the corresponding removal of the package is written down and will be reinstalled later.
Note: The following command will delete all PHP5 related configuration files.
apt-get--purge Remove Php5-common
Then remove the Php5-common when removing the relevant package to re-download the installation.
apt-get Install Php5-common etc.
Example:
[email protected]:~# apt-get--purge Remove php5-commonreading package lists ... Donebuilding dependency treereading state information ... Donethe following packages were automatically installed and is no longer required:libc-client2007e libmcrypt4 Libonig2 Libqdbm14 mlockuse ' Apt-get autoremove ' to remove them. The following packages would be removed:libapache2-mod-php5* libphp-adodb* php-auth-sasl* php-net-smtp* php-net-socket* p hp-pear* php5* php5-cgi* php5-cli* php5-common* php5-curl* php5-ffmpeg* php5-gd* php5-geoip* php5-imap* php5-mcrypt* php5 -memcache* php5-mysql* php5-pspell* php5-xcache*0 upgraded, 0 newly installed, remove and 0 not upgraded. After this operation, 41.7 MB disk space would be freed. Want to continue [y/n]? (Reading database ... 60054 files and directories currently installed.) Removing Libphp-adodb ... Purging configuration files for Libphp-adodb ... removing php5 ... Removing libapache2-mod-php5 ... Module php5 disabled. To activate the new ConfiguRation, need to Run:service apache2 restartpurging configuration files for libapache2-mod-php5 ... dpkg:warning:whi Le removing libapache2-mod-php5, directory '/etc/php5/apache2 ' not empty so not removedremoving PHP-AUTH-SASL ... Removing php-net-smtp ... Removing php-net-socket ... Removing php-pear ... Purging configuration files for php-pear ... Removing php5-cgi ... Error:module php5_cgi does not exist! Purging configuration files for php5-cgi ... dpkg:warning:while removing php5-cgi, directory '/etc/php5/cgi ' not empty so Not removedremoving Php5-pspell ... Warning:pspell module does not exist! Purging configuration files for Php5-pspell ... Removing php5-mysql ... Purging configuration files for php5-mysql ... Removing php5-mcrypt ... Warning:mcrypt module does not exist! Purging configuration files for Php5-mcrypt ... Removing php5-imap ... Warning:imap module does not exist! Purging configuration files for Php5-imap ... Removing PHP5-GD ... WARNING:GD module does not exist! Purging configuration files for php5-gd ... Removing Php5-curl ... Warning:curl module does not exist! Purging configuration files for Php5-curl ... Removing Php5-xcache ... Warning:xcache module does not exist! Purging configuration files for Php5-xcache ... Removing Php5-memcache ... Warning:memcache module does not exist! Purging configuration files for Php5-memcache ... Removing Php5-geoip ... Purging configuration files for Php5-geoip ... Removing php5-ffmpeg ... Warning:ffmpeg module does not exist! Purging configuration files for php5-ffmpeg ... Removing php5-cli ... Purging configuration files for php5-cli ... Removing Php5-common ... WARNING:PDO module does not exist! Purging configuration files for Php5-common ... dpkg:warning:while removing php5-common, directory '/ETC/PHP5/CONF.D ' not Empty so is removedprocessing triggers for man-db ...
[email protected]:~# apt-get install libapache2-mod-php5 libphp-adodb PHP-AUTH-SASL php-net-smtp php-net-socket Php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-ffmpeg php5-gd php5-geoip php5-imap php5-mcrypt php5-memcache p Hp5-mysql Php5-pspell php5-xcache libc-client2007e libmcrypt4 libonig2 libqdbm14 mlockreading Package lists ... Donebuilding dependency treereading state information ... DONELIBMCRYPT4 is already the newest VERSION.LIBMCRYPT4 set to manually Installed.libonig2 is already the newest VERSION.L Ibonig2 set to manually installed.libqdbm14 are already the newest VERSION.LIBQDBM14 set to manually Installed.libc-client2 007E is already the newest version.libc-client2007e set to manually installed.mlock are already the newest Version.mlock SE T to manually installed. Suggested Packages:php5-adodb php5-devthe following NEW packages would be INSTALLED:LIBAPACHE2-MOD-PHP5 libphp-adodb ph P-AUTH-SASL php-net-smtp php-net-socket php-pear php5 php5-cgi php5-cli Php5-commOn Php5-curl php5-ffmpeg php5-gd php5-geoip php5-imap php5-mcrypt php5-memcache php5-mysql Php5-pspell php5-xcache0 Upgra Ded, newly installed, 0 to remove and 0 not upgraded. Need to get 804 kb/12.5 MB of archives. After this operation, 41.7 MB of additional disk space would be used. Want to continue [y/n]? Yget:1 http://ftp.us.debian.org/debian/wheezy/main php-net-socket All 1.0.9-2 [9,068 b]get:2 http://ftp.us.debian.org /debian/wheezy/main php-net-smtp All 1.6.1-1 [22.7 kb]get:3 http://ftp.us.debian.org/debian/wheezy/main Php5-xcache AMD64 2.0.0-4 [Kb]get:4 http://ftp.us.debian.org/debian/wheezy/main libphp-adodb all 5.15-1 [567 kb]get:5 http://ftp . us.debian.org/debian/wheezy/main PHP-AUTH-SASL All 1.0.4-1 [9,530 b]get:6 http://ftp.us.debian.org/debian/wheezy/ Main Php5-ffmpeg amd64 0.6.0-2.2 [23.9 kb]get:7 http://ftp.us.debian.org/debian/wheezy/main Php5-memcache AMD64 3.0.6-6 [60.6 KB] Fetched 804 KB in 2s (295 kb/s) preconfiguring packages ... Selecting previously UNSelected Package Php5-common. (Reading database ... 59432 files and directories currently installed.) Unpacking Php5-common (from .../php5-common_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package php5-cli. Unpacking Php5-cli (from .../php5-cli_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package php-pear. Unpacking Php-pear (from .../php-pear_5.4.41-0+deb7u1_all.deb) ... Selecting previously unselected package php-net-socket. Unpacking Php-net-socket (from .../php-net-socket_1.0.9-2_all.deb) ... Processing triggers for man-db ... Setting up Php5-common (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/mods-available/pdo.ini with new versionsetting up PHP5-CLI (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/cli/php.ini with new versionupdate-alternatives:using/usr/bin/php5 to provide/usr/bin/p HP (PHP) in auto modesetting up php-pear (5.4.41-0+DEB7U1) ... Selecting previously unselected package php-net-smtp. (Reading database ... 59677 files and DirectOries currently installed.) Unpacking Php-net-smtp (from .../php-net-smtp_1.6.1-1_all.deb) ... Selecting previously unselected package php5-cgi. Unpacking php5-cgi (from .../php5-cgi_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package libapache2-mod-php5. Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package Php5-curl. Unpacking Php5-curl (from .../php5-curl_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package php5-gd. Unpacking Php5-gd (from .../php5-gd_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package Php5-imap. Unpacking Php5-imap (from .../php5-imap_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package php5-mcrypt. Unpacking Php5-mcrypt (from .../php5-mcrypt_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package php5-mysql. Unpacking Php5-mysql (from .../php5-mysql_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected PackaGE Php5-pspell. Unpacking Php5-pspell (from .../php5-pspell_5.4.41-0+deb7u1_amd64.deb) ... Selecting previously unselected package Php5-xcache. Unpacking Php5-xcache (from .../php5-xcache_2.0.0-4_amd64.deb) ... Selecting previously unselected package php5. Unpacking php5 (from .../php5_5.4.41-0+deb7u1_all.deb) ... Selecting previously unselected package Libphp-adodb. Unpacking Libphp-adodb (from .../libphp-adodb_5.15-1_all.deb) ... Selecting previously unselected package PHP-AUTH-SASL. Unpacking Php-auth-sasl (from .../php-auth-sasl_1.0.4-1_all.deb) ... Selecting previously unselected package php5-ffmpeg. Unpacking Php5-ffmpeg (from .../php5-ffmpeg_0.6.0-2.2_amd64.deb) ... Selecting previously unselected package Php5-geoip. Unpacking Php5-geoip (from .../php5-geoip_1.0.7-8_amd64.deb) ... Selecting previously unselected package Php5-memcache. Unpacking Php5-memcache (from .../php5-memcache_3.0.6-6_amd64.deb) ... Processing triggers for man-db ... Setting up Php-net-socket (1.0.9-2) ... Setting up Php-net-SMTP (1.6.1-1) ... Setting up php5-cgi (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/cgi/php.ini with new versionupdate-alternatives:using/usr/bin/php5-cgi to provide/usr/b IN/PHP-CGI (php-cgi) in Auto modeupdate-alternatives:using/usr/lib/cgi-bin/php5 to provide/usr/lib/cgi-bin/php ( Php-cgi-bin) in Auto modesetting up LIBAPACHE2-MOD-PHP5 (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/apache2/php.ini with new version[OK] restarting Web server:apache2. Setting up Php5-curl (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/mods-available/curl.ini with new versionsetting up PHP5-GD (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/mods-available/gd.ini with new versionsetting up Php5-imap (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/mods-available/imap.ini with new versionsetting up Php5-mcrypt (5.4.41-0+DEB7U1) ... Creating config File/etc/php5/mods-available/mcrypt.ini with new versionsetting up Php5-mysql (5.4.41-0+DEB7U1) ... Creating Config file/etc/php5/Mods-available/mysql.ini with new versioncreating config File/etc/php5/mods-available/mysqli.ini with new versioncreating config File/etc/php5/mods-available/pdo_mysql.ini with new versionsetting up Php5-pspell (5.4.41-0+ DEB7U1) ... Creating config File/etc/php5/mods-available/pspell.ini with new versionsetting up Php5-xcache (2.0.0-4) ... Setting up PHP5 (5.4.41-0+DEB7U1) ... Setting up Libphp-adodb (5.15-1) ... Setting up PHP-AUTH-SASL (1.0.4-1) ... Setting up Php5-ffmpeg (0.6.0-2.2) ... Setting up Php5-geoip (1.0.7-8) ... Setting up Php5-memcache (3.0.6-6) ... Processing triggers for LIBAPACHE2-MOD-PHP5 ... [OK] Reloading Web server config:apache2.
pdo_mysql.so:undefined Symbol:pdo_parse_params in Unknown on line 0