2

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
kelvinelove
  • 1,617
  • 1
  • 16
  • 26
shyam
  • 131
  • 1
  • 1
  • 4

4 Answers4

3

sudo apt-get install php-pdo-mysql

Ara
  • 31
  • 2
  • Can you provide more explanation about what is `php-pdo-mysql`package? for example, what contains that package, ... – damadam Nov 16 '19 at 11:47
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,

shyam
  • 131
  • 1
  • 1
  • 4
0

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
Alex Austin
  • 146
  • 5
  • Already installed and done downgrade sudo a2dismod php7.0 sudo a2enmod php5.6 sudo service apache2 restart – shyam Oct 06 '17 at 11:27
  • did you do apt update? – Alex Austin Oct 06 '17 at 11:36
  • Hi Vichu, Not working tried change the cd /etc/php/5.6/apache2 nano php.ini but not working – shyam Oct 06 '17 at 11:38
  • what is the output of php -m? – Alex Austin Oct 06 '17 at 11:59
  • Alex, Here is output calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv json libxml mbstring mcrypt mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline Reflection session shmop SimpleXML soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib – shyam Oct 09 '17 at 04:38
  • have you tried apt-get install pdo-mysql? – Alex Austin Oct 10 '17 at 22:11
0

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")

Vichu
  • 101