PROBLEM DESCRIPTION :
No matter what code I put in login.php I always got this error :
Fatal error: Uncaught PDOException: could not find driver in
C:\MAMP\htdocs\website\login.php:4
Stack trace: #0 C:\MAMP\htdocs\website\login.php(4): PDO->__construct('C:\\Users\\neb\\...') #1
{main} thrown in C:\MAMP\htdocs\website\login.php on line 4
I'm using MAMP I have installed php. When I check in the EV(Environment variables) it's in Path :\MAMP\htdocs\website\php8.2.4
So my php is actually php8.2.4 BUT the php of MAMP is 7.4.1 I don't know If it has something to do with the error.
CODE :
<?php
$fullname = "Adam";
echo "Hi $fullname and welcome on the website!";
?>
I also tried with :
<?php
phpinfo();
?>
But as I said earlier no matter what I put in login.php I got the same error
WHAT I'VE TRIED :
- check if php was installed with php --version in cmd
- install php
- change the directory of php
I still don't know how to solve this please help
EDIT
I did replace php8.2 by php7.4.1 and Also restart MAMP But the error persist
EDIT 2 :