Welcome Guest, Not a member yet? Register   Sign In
base_url() undefined
#1

[eluser]Ty44ler[/eluser]
I'm in the process of transferring my site to a new host. I've changed the config.php file so that the path is correct, but I still receive the error:

Quote:Fatal error: Call to undefined function base_url() in /home/ty44ler/public_html/----/---/----/---/home.php on line 1

My autoloader also is set to:
Quote: $autoload['helper'] = array('url');

Does anyone have any ideas why base_url() is not working?
#2

[eluser]InsiteFX[/eluser]
Did you set your system and application folder paths in the index.php file?

Also if your using CI 2.0 you can try and see if it will auto find your base_url

If you have a .htaccess file check that also.

InsiteFX
#3

[eluser]Ty44ler[/eluser]
yep...

Quote:$system_folder = "core";

$application_folder = "program";

They are in the same folder as index.php.


I changed the url to the base url in .htaccess, but it didn't work either.

I set $config['uri_protocol'] = "AUTO"; in config.php as well.
#4

[eluser]davidbehler[/eluser]
Code:
undefined function base_url()
Sounds to me like something is wrong with your CI install. Have you tried re-uploading all system files? And try renaming your system folder to something else than "core"...there might be some naming conflict.
#5

[eluser]Ty44ler[/eluser]
How do I go about reinstalling it? I did not initially install it and the company that created the site went out of business so I'm left picking up the pieces...
#6

[eluser]davidbehler[/eluser]
First you should find out what version of CI you have installed. Easiest way to do this is to go to your system folder/codeigniter/CodeIgniter.php, open it and see what's defined as CI_Version.

Then download a fresh copy of that version of CI, backup your old system folder and replace it with the new one.

Let's just assume they didn't alter any files in the system folder but rather extended the libraries in the application folder. If that's not the case you'll have to copy all the altered files from your backup folder to the new system folder..good luck with finding out which ones were changed Wink

Another step to make debugging easier is to remove the .htaccess file for now and set $config['index_file'] to 'index.php' in application folder/config/config.php. This way you can make sure it's not the htaccess file that causes this.

Another question: Is this a new problem and the site was working before? If so, what did you/the hoster change?
#7

[eluser]Ty44ler[/eluser]
Just to answer your question before I start messing things up... The site was never working on the new server/host, it still works on the old server/host.

Thanks for you help so far. I'll give this a go and get back to ya!
#8

[eluser]Ty44ler[/eluser]
Well, I just copied my system folder and changed the name in the index.php to match and I get the same error. I'm not sure if this is something too, but when I access the pages on the old site they end like: business/register/ whereas now I can only reach the pages by going to: /program/views/business/home.php

I also removed the .htaccess as well and updated the index.php page.

Am I totally screwed?
#9

[eluser]davidbehler[/eluser]
business is your controller and register is the function in that controller.
/program/views/business/home.php is the view file that's being loaded by the controller.

what happens when you got to the url of your website without anything else in the url? does that work?

try changing $config['uri_protocol'] in application folder/config/config.php, maybe that's the problem.
#10

[eluser]Ty44ler[/eluser]
Quote:try changing $config[‘uri_protocol’] in application folder/config/config.php, maybe that’s the problem.
I've had this set to AUTO and REQUEST_URI, but neither change anything.

when I just type in my address the home page pulls up fine. It's all the other pages that don't work right. In the original site it linked to .com/business/register/ to get to the register page... when I do that on the new site, it gives me 404 error.

It's probably also worth mentioning this is in a subfolder on the server, not the primary domain, but I changed the path in the index.php file so Im thinking it should be alright.




Theme © iAndrew 2016 - Forum software by © MyBB