Welcome Guest, Not a member yet? Register   Sign In
loading ci4 app on server
#1
Big Grin 

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
Reply
#2

(This post was last modified: 03-26-2025, 12:31 PM by captain-sensible.)

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

{
//code block 
}

catch ( \Exception  $e)
{

$data = [
'title'  => 'info',
 
  'info'=>'something went wrong with new blog' ,
  'infoException'=>'the problem is :'.$e->getMessage(),
  'date'=>$this->myDate,
];

echo view('info2', $data);
die();

}

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
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#3

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?
Reply
#4

(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
[Method: GET, Route: /]
in SYSTEMPATH/I18n/TimeTrait.php on line 266.
1 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
CRITICAL - 2025-03-22 11:46:39 --> Error: Class "CodeIgniter\I18n\Time" not found
[Method: GET, Route: /]
//CodeIgniter\I18n\TimeTrait::
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.
require FCPATH . '../app/Config/Paths.php';
// ^^^ Change this line if you move your application folder





ON my hosting i have capacity of having up to 20 additional domains via  having web apps  in sub-directories of my main hosting .

[Image: webstructure.png]


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
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#5

intl is enabled. I put /writable/log in the url but i give back 404 not found
Reply
#6

you have to access writable/log via cPanel of your hosting .

You have to physically navigate there ,not use a url
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#7

should i ask the company witch gave us the server about it?
Reply
#8

i told them about c panel they told me you can access by ssl or fstp via filezilla or putty to upload file SFTP
Reply
#9

(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
how to you know  intl is enabled on the server ? 
Is CI4  now loaded into the server , if you dont have cPanel how did you edit path in 
Code:
/ This is the line that might need to be changed, depending on your folder structure.
require FCPATH . '../app/Config/Paths.php';
// ^^^ Change this line if you move your application folder

now if  CI4 is loaded , there is a script i can offer  which will run through CI4 and change permissions of dirs and files , and see if ti can help.
My recommendation is to use "putty"    : https://www.putty.org/     
its what i use to connect to my hosting when i want to  run  say "artisan" on another php framework.  
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB