paitakht_pc
paitakht_pc

Reputation: 27

how install pdo-mysql in centos7

I install laravel 5 and then install packages neede.

I install php-pdo and some other but now i cant install pdo-mysql and laravel return error.

PDOException in PDOConnection.php line 47: could not find driver 

I am use Centos 7 and PHP 5-6-29.

Upvotes: 2

Views: 38934

Answers (4)

stillatmylinux
stillatmylinux

Reputation: 1429

Try using this

yum install php-mysql
systemctl restart httpd

Upvotes: 4

Ajay Gadhavana
Ajay Gadhavana

Reputation: 443

You can search package like

yum search php


Pick the ones you need and install them like this:

yum -y install php-mysqlnd php-pdo


In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, and Drupal:

yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel

Upvotes: 4

Remi Collet
Remi Collet

Reputation: 7031

Check which package is installed (which provider) and provides the stack, then use the same namespace.

  • Webtatic uses php56w-*
  • IUS uses php56u-*
  • remi-safe (SCL packages) use php56-php-*
  • remi-php56 simply use php-*
  • other providers can use something else

As you need pdo_mysql driver, simply

yum install <namespace>-pdo_mysql

(using the ext name, yum will find the correct package name which provides this ext).

Also check you don't have any "exclude" lines in the yum configuration (such as the ones provided in altered cpanel distributions)

Upvotes: 8

Donii Hoho
Donii Hoho

Reputation: 381

https://webtatic.com/packages/php56/

I believe the driver is php56w-mysql so yum install php56w-mysql should do the job.

Upvotes: 1

Related Questions