Srini
Srini

Reputation: 387

Include config file using url?

I have struggled with including config file in php. i have a config.php file in TAA/system/application/config but i need to include that config file to my local.php presented in TAA/ so i did this but it throw error message.

  1. http:// wrapper is disabled in the server configuration by allow_url_include=0

  2. failed to open stream: no suitable wrapper could be found

i include the config file using include("http://baseurl/TAA/system/application/config/config.php");

Upvotes: 1

Views: 458

Answers (1)

alex
alex

Reputation: 490153

Don't specify the http: protocol. That will just make PHP request the file using HTTP. You also have allow_url_include disabled in php.ini.

Instead, use include __DIR__ . '/system/application/config.php';

If you are using < 5.3, then replace __DIR__ with dirname(__FILE__).

Upvotes: 5

Related Questions