⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Changing localhost to ip address not working



Joeb
  • profile picture
  • Member

Posted 13 December 2015 - 02:10 AM

I have everything working on my raspberry pi and developing things for a new site for my farm. I have in the database.php file 'hostname' => 'localhost'; but when I change it to my static ip address that is all set up and working comming from the pi I get this error and do not know what to do from here. I have searched on the forum and web but no answer.

 

Here is the error I get.

 

A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/2005): Unknown MySQL server host 'http://66.109.223.155/' (2)

Filename: mysqli/mysqli_driver.php

Line Number: 161

Backtrace:

File: /var/www/html/grocerycrud/application/controllers/Examples.php
Line: 9
Function: database

File: /var/www/html/grocerycrud/index.php
Line: 292
Function: require_once

If you go to my pi now you will see it from anywhere but not when I go into my admin page which does work with localhost but not with my ip address.

 

I have also looked at the index.php file where you can set the base_path and that did not work as well.

 

HELP


Joeb
  • profile picture
  • Member

Posted 13 December 2015 - 20:46 PM

(SOLVED) I found a config file that I did not see that we needed to do anything to it in the instructions but in the file you need to make sure you add the url to the correct path.

It is in config.php first one needs to be filled in. I also left localhost in the other config file called database.php.

Admin can you edit the first tag and put in SOLVED