logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Localhost error PHP connect
Author
Peekay



Joined: 31 Jul 2018
Posts: 4
Location: South Africa, Witbank

PostPosted: Mon 20 Aug '18 16:39    Post subject: Localhost error PHP connect Reply with quote

When I type in 'localhost' in my IE, it reads my own compiled index.php file in the root folder which I have set, but as soon as I give it another path it generates an error:

Could not connect to MySQL: php_network_getaddresses: getaddrinfo failed: No such host is known

It has to do with not connecting with the MySQL database with data from my login.php file, I think, although I have been able to connect to the database previously many times with this file.

Any suggestions will be welcomed.
Thanks
Back to top
Peekay



Joined: 31 Jul 2018
Posts: 4
Location: South Africa, Witbank

PostPosted: Mon 20 Aug '18 16:43    Post subject: Code used Reply with quote

Sorry, here is my php file:

<?php // loginlocal.php
define ('DB_USER','root');
define ('DB_PASSWORD','*********98');
define ('DB_HOST','localhost/IBSMSlocal/htdocs');
define ('DB_NAME','IBSMStemplate');
$dbc = @mysqli_connect (DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die ('Could not connect to MySQL: ' . mysqli_connect_error() );
mysqli_set_charset($dbc,'utf8');
?>
Back to top
Peekay



Joined: 31 Jul 2018
Posts: 4
Location: South Africa, Witbank

PostPosted: Mon 20 Aug '18 17:01    Post subject: Solved thanks Reply with quote

My path was incorrect in the login file. Sorry
Back to top


Reply to topic   Topic: Localhost error PHP connect View previous topic :: View next topic
Post new topic   Forum Index -> Other Software