loading ci4 app on server |
Goodmorning,
i'm loading ci4 4.6 version app from local to server online. i ve seen some post online but no one helped me. Every time i enter the url of the domain i don't see the the relative page. i have var -> www -> html folders. Thank you
provide as much info as you can ; you've not actually provided even an actual evidence of an error . Whats the url to your domain ?
what os were you developing on. What steps did you take to get online ? you can leave debug level 9 and leave this line in .env to help get info Code: CI_ENVIRONMENT = development All sorts of issues on CI4 and other frameworks can result in files not being 644 and dirs 755 chmod permissions did you look at logs ? its useful to stick try catch blocks in controllers eg Code: try So while in dev i have try catch like above; when something is a miss i try to get error and for my convenience get it output nicely to a info view . yeah we want security ; but that comes after its up and working
the domain is: 6insquadra.energiagioiosa.it and i'm developing it with windows 11. i'm using xampp. On the server is loaded ubuntu.
What i did is to put all the content of public folder in the main folder of the app at the level of app,system,test etc. i changed App in app/config and gave base url 6insquadra.energiagioiosa.it and in index.php . How to look at logs?
03-27-2025, 03:00 AM
(This post was last modified: 03-27-2025, 04:04 AM by captain-sensible. Edit Reason: usual suspects )
ok @xmax1991 path to logs CI4 is webroot/writable/logs
you can navgate using file manager, hopefully you have cPanel. There will be a list of logs with dates. To read a log file, mouse right click on a file and cPanel should give you an option to "view" or edit . Click on view , click on any defualt offerings that come up , like it might say utf-8 Here is part contents of a log i opened in localdevelopment: Code: CRITICAL - 2025-03-22 11:46:39 --> ErrorException: Declaration of CodeIgniter\I18n\TimeTrait::createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null): static must be compatible with DateTimeImmutable::createFromTimestamp(int|float $timestamp): static So thats giving me a good clue, i can navigate to vendor and navigate to webroot/vendor/codeigniter4/framework/system/I18n i will see a TimeTrait.php file. I can have a look at it. I can google key words. Now with live hosting there are basically 2 approaches . you way you have gone, the inside contents of your Ci4 public should be inside your main hosting and everything else outside public and as you say in public/index.php edit : Code: / This is the line that might need to be changed, depending on your folder structure. ON my hosting i have capacity of having up to 20 additional domains via having web apps in sub-directories of my main hosting . ![]() So this is my hosting stucture of hosting document root ; the red circle is a full website .Lets say its called joesoap.com I bought joesoap.com , separate from my hosting. I go to my account domain gui and point my domain the server ns1 and ns2 of the hosting. I go into my hosting account and "add" domain then i go to subdomains and add an entry so that http request are listened to from the "public " directory of my web site in its subdomain . No messing or editing of .htacess file needed. Now if you come from windows you might be familiar with "permissions" but you can get a from memory a "500" just because one file had the wrong permissions . from Cpanel if you navigate to the sub directory say joesoap.com you can should be able to see on the right hand side a list of permissions like 0644 0755 . Lets take public make the directory itself permission 0755; by right clicking on it and change permissions. Make every file inside the public directory permissions 0644 . Then you should have option to chose php version on cPanel Laravel needs above php 8.3 , last time i looked at it CI4 8.2 ; but read .Also you should have option as to what is enabled . Make sure "intl" is enabled https://www.codeigniter.com/user_guide/i...ments.html Let us know how you get on, and what the logs say
intl is enabled. I put /writable/log in the url but i give back 404 not found
i told them about c panel they told me you can access by ssl or fstp via filezilla or putty to upload file SFTP
03-28-2025, 05:02 AM
(This post was last modified: 03-28-2025, 05:26 AM by captain-sensible. Edit Reason: usual suspects ) (03-27-2025, 05:31 AM)xmax1991 Wrote: intl is enabled. I put /writable/log in the url but i give back 404 not found |
Welcome Guest, Not a member yet? Register Sign In |