Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] CI4 on Shared Hosting. Can't load views.
#1

(This post was last modified: 03-30-2020, 11:43 AM by jreklund.)

I was trying to play and learn codeigniter 4 my code was working perfectly on my local host (Xampp) then i decide to test on live server (Shared Hosting). There i got stuck i dont know where to go what else to do because what i use in local host is the same i uploaded to live server.

Screen shot of my localhost login page

Local host page view here
[Image: 9fb23ac933d201ccde519ea7ef2ed441.png]

and here is the sources code to the above page

[Image: c488ba13654e4e913367e12a31292ce4.png]

Now in my live server here the page shows

[Image: d41db67f6581f257dccc7de136ed2242.png]

This is wired after how many months of develping this application i really do not know where to go from here because i was totally confuse and i dont know what to do again.

The sad path is that if my method is to load pure php page for example return view('welcome');

can you believe if i told you that welcome page will open up but i still dont understand my smarty template is not loading.

Every thing work correctly on my local server i found it hard on live server now.

i dont know what to do anymore just confuse.
Reply
#2

As you have developed on Windows and not Linux it's most likely a case-sensitive matter. Your files/folder may be named Auth/Auth.tpl but you can on Windows load them as auth/auth.tpl. But you should load them as Auth/Auth.tpl. So you need to check your capitalization.

You should also move your files one path down. You should not access CI as /public/, so your index.php are placed in the wrong folder.
Reply
#3

(This post was last modified: 03-30-2020, 09:54 AM by seunex.)

(03-30-2020, 09:40 AM)jreklund Wrote: As you have developed on Windows and not Linux it's most likely a case-sensitive matter. Your files/folder may be named Auth/Auth.tpl but you can on Windows load them as auth/auth.tpl. But you should load them as Auth/Auth.tpl. So you need to check your capitalization.

You should also move your files one path down. You should not access CI as /public/, so your index.php are placed in the wrong folder.


Hi thank you for your response my told file are lowercase in view folder have a sub folder auth >> auth.tol. this is how I do use them I use smarty also in ci3 and I have no problem I probably don't know what is going wrong here.
But if I try to load the details welcome page of ci4 it will will work but I can not load my told file here
Reply
#4

I guess you need to debug smarty, getting the absolute path it's trying and correcting it from there.
Reverse where $this->source->exists get checked, and see how it tries to look for the file.
Reply
#5

(03-30-2020, 10:30 AM)jreklund Wrote: I guess you need to debug smarty, getting the absolute path it's trying and correcting it from there.
Reverse where $this->source->exists get checked, and see how it tries to look for the file.

May God bless you and add to your knowledge bro!

Case sensitive from my smarty class i load views instead of Views.

You save y day stay bless!
Reply
#6

I'm glad it worked out. I updated the subject to solved and added what that the problem where regarding views.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB