EllisLab text mark
Advanced Search
Fatal error: Call to undefined function:
Posted: 25 September 2009 10:01 AM
Joined: 2008-07-30
3 posts

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.

<?php echo base_url() ; ?>

Page rendered in {elapsed_time} seconds

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.


Posted: 25 September 2009 10:10 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-07-23
98 posts

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


CI Simple CRUD (not mine): http://henrihnr.wordpress.com/2009/04/26/simple-crud-application/

Posted: 25 September 2009 10:15 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2008-07-30
3 posts

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