php can't connect to MySQL

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jun 18, 2017 7:49 pm

Sun Jun 18, 2017 7:56 pm

Installed Apache 2.4, PHP 5.6, MySQL 5.7 successfully.

But, php can't connect to MySQL (tested both mysqli and PDO), both not working.

phpinfo page shown mysqlnd installed.

please help.

User avatar
php-forum Active User
php-forum Active User
Posts: 348
Joined: Mon Feb 22, 2016 5:52 pm

Mon Jun 19, 2017 1:57 pm

Have you created a database?

Would suggest to only use pdo to connect to database as MySQL functions are deprecated and will not work in php 7, (MySQL will still be used, but connect through PDO).

Please post code using the </> button in the post a reply box.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests