Codeigniter 3 - call to undefined function base_url() Fixed

November 5, 2017 | Category : Codeigniter PHP

Hi, Friends

In this tutorial i will show you how to solve base_url() function not working in codeigniter 3.

When i was starting to work on my codeigniter 3 project few days ago. I just followed to some tutorial from google. But when i used base_url() in codeigniter 3 project as explained in tutorial. After run project i found following error.

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

I was thinking, how to resolve this error because i simply download codeigniter 3 project from scratch and why this error for base_url(), So finally i found how to solve this error. We have to add "url" helper in autoload.php file.

If you also see this type of error then you can fix by only load url helper on followinf file:

application/config/autoload.php

....

$autoload['helper'] = array('url');

....

After adding above url helper, i solved my problem.

I hope you will get your best solution...