Celeb Glow
news | March 27, 2026

Not able to enable pdo_mysql extension or not able to install

I am using Ubuntu 16.04.3 LTS , Using PHP version 5.6 i have required 5.6 version only not required php latest version

I tried to install or tried to enable but not working:

 sudo apt-get install php5-gd php5-mysql
E: Package 'php5-mysql' has no installation candidate

I am getting below error.

pdo_mysql extension is not installed
1

4 Answers

sudo apt-get install php-pdo-mysql

1

Thanks for your help, i have resolved issue.

I have executed below commands in terminal.

sudo a2dismod php7.0
sudo a2enmod php5.6
sudo apt-get install php5.6-mysql
sudo service apache2 restart

Thanks,

As of version 16.04, Ubuntu comes with php7 by default. You need to install php5 repository. This might help:

#sudo add-apt-repository ppa:ondrej/php
6

try doing something like

extension=pdo.so
extension=pdo_mysql.so

in your php.ini

restart the webserver (e.g. with "sudo service apache2 restart")

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy