Welcome Guest, Not a member yet? Register   Sign In
Unable to load the requested file: helpers/my_url_helper.php
#1

[eluser]lynkyle[/eluser]
I have been coding with CI for almost a month and I just uploaded my project on a live server today and CI gives me said error.

Just let me reiterate, on my localhost, everything is working perfectly, so I'm a bit stomped.

I have an 'extended' url_helper because one of the said helper's function is clashing with phpbb.

Maybe I just overlooked something, or it can also be an server setup messing with things, I don't know.

I have tried loading the default url_helper and sure enough, it gave me this error: Fatal error: Cannot redeclare redirect() in /home/xxx/public_html/xxx/phpbb/includes/functions.php on line 1805

Anyone can help me with this? Will be highly appreciated.
#2

[eluser]xwero[/eluser]
You can rename the redirect function in CI to ci_redirect and everything should work. I think renaming the function in CI is the easiest because it's optional and you know where you added the redirect. With phpbb you don't know where and how they used it unless you are willing to search through the whole phpbb code.
#3

[eluser]lynkyle[/eluser]
I have been digging up the forums since I've delved into CI and I have been reading many of your posts helping others. So thank you very much.

Now, onto this matter. Yes, I know I can rename the redirect function, matter-of-fact, it was my first impulse when I first encountered the 'cannot redeclare redirect error'. But, as I have read the manual and come to understand CI more, I learned that CI helpers can be 'extended' in a way. So I tried that route and as I've mentioned, been working great with my development server.

Now, as I was waiting for someone to help me out on this, I did dig further as I have tested my project to two live servers, and neither of them is working. The other one is godaddy, (that's a different matter with regards to this though I've read to append a '?' after index.php in my router - I'll be facing that problem later).

Now, on this server, PHP 5 is running as CGI (Server API - CGI/FastCGI on my phpinfo()). I have also learned that all sorts of bugs creep up when PHP is ran as CGI. But I am still particularly interested with this problem I have. Seems a bit unique as I have not been able to find a similar problem since digging in this forum for the last 5 hours...
#4

[eluser]xwero[/eluser]
The Helpers can be extended because they look if a function exists or not. If the helper is loaded it first checks it the extended file exists. if it does the extended file is included, afterward the 'normal' helper file is included.

I'm not sure why it works on your development server because the function is added to the global namespace so even if you extend the helper with a renamed function the redirect function will be created.




Theme © iAndrew 2016 - Forum software by © MyBB