0

I am trying to connect to a database in MySQL server on MAMP (PHPMyAdmin). However, whenever I refresh my webpage, the error "This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500. Where did I go wrong?

        $pdo = new PDO ('mysql:host=127.0.0.1;dbname=myPatient', 'root', 'root');
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        return $pdo;
S. Patel
  • 13
  • 3
  • Type on terminal **tail -n 20 /Applications/MAMP/logs/php_error.log** This may give you some clue as to what is going on. – munsifali Jul 13 '18 at 04:44
  • You went wrong by not looking at the log files to see what the actual error is. 500 HTTP status code is just generic for "something went wrong". See also: https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Mike Jul 13 '18 at 04:44
  • Thanks. Didn't know that 500 HTTP is a generic statement. Will check into this. – S. Patel Jul 13 '18 at 15:31

0 Answers0