I am a server newbie so please bare my foolishness.
This is more a Server problem (I think) rather than a Laravel problem, but my website is based on Laravel5.4 so Just FYI.
I am currently using Google Cloud Platform to set up a VM which seemingly works as any others.
Currently installed:
so i put my website folder into /var/www/html/mywebsitefolder
I set up mysql database and configure my website config for database set up and tried to run php71 artisan migrate
at this point. And it throws the following errors:
PHP Fatal error: Class 'PDO' not found in /var/www/html/soyegg/vendor/laravel/framework/src/Illuminate/Database/Co nnection.php on line 1200 In Connection.php line 1200: Class 'PDO' not found
which i researched and said php-pdo needed to be installed so I ran the following line in cli:
yum install php-pdo
yum install php-pdo_mysql
however the error still persists.
Then I further researched and said I need explicitly stated extension in php.ini
in order to use them. But when I check my php.ini
for php71 it doesn't involve any line looks any like the following which others said they are supposed to be added into php.ini
:
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
I am noob so I guess php71 doesn't play extension like this? But I still added it somewhere in php.ini
where it comments about extension.
Then more errors threw out.
Please Let me know what is going on.
EDIT: Thanks for Daniel, after running yum install php-mysqlnd
the following error shown:
> Loaded plugins: fastestmirror Loading mirror speeds from cached
> hostfile * base: mirror.team-cymru.com * epel: mirror.steadfast.net
> * extras: mirror.team-cymru.com * remi-safe: mirror.team-cymru.com * updates: mirror.genesisadaptive.com Resolving Dependencies
> --> Running transaction check
> ---> Package php-mysqlnd.x86_64 0:5.4.16-45.el7 will be installed
> --> Processing Conflict: php-mysql-5.4.16-45.el7.x86_64 conflicts php-mysqlnd
> --> Finished Dependency Resolution Error: php-mysql conflicts with php-mysqlnd-5.4.16-45.el7.x86_64 You could try using --skip-broken to
> work around the problem
> ** Found 12 pre-existing rpmdb problem(s), 'yum check' output follows: 1:NetworkManager-1.10.2-14.el7_5.x86_64 has missing requires of
> NetworkManager-libnm(x86-64) = ('1', '1.10.2', '14. el7_5')
> 1:NetworkManager-1.10.2-16.el7_5.x86_64 is a duplicate with
> 1:NetworkManager-1.10.2-14.el7_5.x86_64
> binutils-2.27-28.base.el7_5.1.x86_64 is a duplicate with
> binutils-2.27-27.base.el7.x86_64 gnupg2-2.0.22-5.el7_5.x86_64 is a
> duplicate with gnupg2-2.0.22-4.el7.x86_64
> google-cloud-sdk-207.0.0-1.el7.noarch is a duplicate with
> google-cloud-sdk-204.0.0-1.el7.noarch
> google-cloud-sdk-208.0.1-1.el7.noarch is a duplicate with
> google-cloud-sdk-207.0.0-1.el7.noarch
> google-cloud-sdk-208.0.2-1.el7.noarch is a duplicate with
> google-cloud-sdk-208.0.1-1.el7.noarch
> google-cloud-sdk-209.0.0-1.el7.noarch is a duplicate with
> google-cloud-sdk-208.0.2-1.el7.noarch httpd-2.4.6-80.el7.centos.x86_64
> has missing requires of httpd-tools = ('0', '2.4.6', '80.el7.centos')
> httpd-2.4.6-80.el7.centos.1.x86_64 is a duplicate with
> httpd-2.4.6-80.el7.centos.x86_64
> selinux-policy-targeted-3.13.1-192.el7_5.3.noarch has missing requires
> of selinux-policy = ('0', '3.13.1', '192.el7
> _5.3') selinux-policy-targeted-3.13.1-192.el7_5.4.noarch is a duplicate with selinux-policy-targeted-3.13.1-192.el7_5.3.no arch
MariaDB is a branch of MySQL so install the PHP 7.1 version of the PDO driver for MySQL by running
yum install php7.1-mysql
This should automatically add it to the loaded configuration php.ini
file.
Try the following command:
yum install php71w-mysqlnd
If the installation is executed by this command then it will be added automatically to php.ini
configuration file.