Amazon EC2:如何启用MySQL和SQLITe

The EC2 instance I have been given has php7 installed but without mysql and sqlite3 modules thus unable to use.

I tried sudo yum install php-pdo but it gave error:

amzn-main                                                | 2.1 kB     00:00     
amzn-updates                                             | 2.5 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-pdo-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php70-common-7.0.21-1.24.amzn1.x86_64 conflicts php-common < 5.5.22-1.98

You need the php7 packages. php-* currently installs PHP 5.6 extensions, that’s why you get the dependency conflict error

e.g.

yum install php70-pdo

The various MySQL extensions are in the package php70-mysqlnd