Database IP as parameter


I’m using Piwik with SVN on my local machine and on the online live system. All the files are the same. I want to insert my local data to localhost and on the live system to another database, which has a separate IP and is not localhost.

The problem is, I can’t use php code in the config.ini.php to check whether the script runs online or on the local machine and return a different IP . Can I use the bootstrap.php file to manage that somehow or is there another solution ?

Thank you very much for you help!

I don’t really understand what’s going on. sorry, can you try again?

ok, sure: I want to use the same piwik code on my local system (for testing) as on the server. On my local system I use localhost ( as the database ip. For my online website I can’t use as IP, because the database is not on the same server as my website. So if I would just upload my local piwik folder it won’t work, because online is no database at - it is on (example).

So I have to modify the code somehow like

if ( file_exists(’/Applications/MAMP/htdocs’) ) // My local machine
$host = “”;
$host = “”;

The problem is, I can’t use that php code in the to change

host = “localhost”


host = $host

Do you understand the question ? B)
Thank you very much !