Can't connect to database in localhost via PHP
Posted: 03. February 2017 13:15
My problem is: a fresh new XAMPP installation, everything seems fine.
PhpMyAdmin works nicely.
Websites cannot connect to DB.
It is like "localhost" is meaningless for the websites, while PMA doesn't give a damn, he just can do it..
OK I have tried lot of things, nothing worked so far:
* Turned off antivirus, skype, various other useless things.
* Ran as administrator XAMPP.
* Installed Apache and MySQL (mariadb) as services via XAMPP Control Panel.
* Changed default port to 8080.
* Forced ipv4.
* Used "127.0.0.1" string instead of "localhost" (as does PMA).
* Moved the website as a subfolder of xampp/htdocs (to try without configuring a virtualhost).
* Copied the same apache options of phpmyadmin.
* Used MariaDB 5.5 instead of the default 10.1
* Checked Mysql and Apache logs
* Googled a lot.
* Prayed various Gods.
* Looked at the screen for 10 minutes straight having a very angry face.
* Yelled bad words.
I have also WAMP, which works perfectly (of course is not running while testing XAMPP)
I am using XAMPP now just to have a fresh new and modern develpment environment for recent websites.
Any idea, please??
PhpMyAdmin works nicely.
Websites cannot connect to DB.
It is like "localhost" is meaningless for the websites, while PMA doesn't give a damn, he just can do it..
OK I have tried lot of things, nothing worked so far:
* Turned off antivirus, skype, various other useless things.
* Ran as administrator XAMPP.
* Installed Apache and MySQL (mariadb) as services via XAMPP Control Panel.
* Changed default port to 8080.
* Forced ipv4.
* Used "127.0.0.1" string instead of "localhost" (as does PMA).
* Moved the website as a subfolder of xampp/htdocs (to try without configuring a virtualhost).
* Copied the same apache options of phpmyadmin.
* Used MariaDB 5.5 instead of the default 10.1
* Checked Mysql and Apache logs
* Googled a lot.
* Prayed various Gods.
* Looked at the screen for 10 minutes straight having a very angry face.
* Yelled bad words.
I have also WAMP, which works perfectly (of course is not running while testing XAMPP)
I am using XAMPP now just to have a fresh new and modern develpment environment for recent websites.
Any idea, please??