简体   繁体   中英

Codeigniter is ok with localhost, but on a live server it says “database.php does not exist”, how can I locate my database if I use linux cPanel?

I have been searching stackoverflow and all across google to find and answer to this, but I have no luck.

I think I know what my problem is, but I don't know the solution for it.

In my codeigniter index.php configuration on my localhost, my code looks like this.

$root = dirname(__FILE__);
switch ($root) {
    case '/Applications/XAMPP/xamppfiles/htdocs/myproject':
        define('ENVIRONMENT', 'development');
    break;
    default:
        define('ENVIRONTMENT', 'production');
    break;
}

I am now using a live host with a linux hosted server with cPanel, and I don't know how to locate public_html, can someone help me on what do I have to put in this "case '/Applications/XAMPP/xamppfiles/htdocs/myproject':"??

Thank you in advance!

Cpanel/WHM Default directory for public_html is:

/home/ cpanel-username /public_html

Here are some more common directories if needed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM