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

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

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest