Error 500 in php code with linux

Asked

Viewed 89 times

0

I have the following connection to the bank:

$pdo = new PDO('mysql:host=localhost;dbname=teste;charset=utf8', 'root', '');

In windows it works perfectly when I started the project on linux from error 500. I already installed the mysql in linux, I was able to access and create the database.
Is there a specific command for linux?

  • Already tried using mysqli instead of mysql?

  • already and gives the same error

  • you have php and apache installed in the linux environment?

1 answer

1

Not to give error 500 and present correct error /etc/php/version/apache2/php.ini and change the display_errors line to On.

Regarding the error, without knowing exactly which error is being presented the possible cases are:

  1. User, password, or table incorrect
  2. If you are using namespace put PDO instead of PDO
  3. PDO not installed, install php package version-Pdo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.