Fatal error: Call to undefined function:

Ok peeps, here is one for ya.

While migrating code from my development environment to my hosting site I ran into issues with calls to base_url.

"Fatal error: Call to undefined function: base_url() in..."

In order to sort out what might be happening, I wiped the slate on my hosting environment and re-installed the base code of CI v1.6.3 and modified the config file to reflect the hosted URL.

After I got the base install working and the welcome message displays correctly. I added the following debug code to the welcome view.

&lt;?php echo base_url() ; ?&gt;
<p><br />Page rendered in {elapsed_time} seconds</p>

I did some other tests, and found that calls to index_page(), site_url() also fail.

I have confirmed that the url_helper.php file is where it should be.

My config file isn't defining any strangeness for instance:

$config['base_url'] = "http://www.mydomain.com/admin/";
$config['index_page'] = "index.php";
$config['uri_protocol'] = "QUERY_STRING";

And I am not using an .htaccess directives.

Wacky stuff no?

I welcome any feedback, support.


You may have confirmed this already, but is the URL helper definitely (auto)loaded?

OK so now I feel silly. That was it. I forgot that I needed to auto_load the helper files.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.