![]() |
CI4 - Installation Location FOLDER example - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9) +--- Thread: CI4 - Installation Location FOLDER example (/showthread.php?tid=77342) |
CI4 - Installation Location FOLDER example - jinbatsu - 08-19-2020 I'm seeing so many people did not understand what public folder means. Default Folder Structure from CI4
What we should implement for localhost such as xampp, example in Windows, location in D:/xampp And we want keep multi folder for our project, and we do not want to change httpd.conf everytime we switch the project what we work, specially if those project are linked on each project. So, what we want to setup is like this, we should use the same folder name, so then we do not confuse by our self:
From this PHP Code: // Path to the front controller (this file) PHP Code: // Path to the front controller (this file) For using MAMP or the like, then we can point folder with additional public folder (just like for webhosting in below). For webhosting (shared, vps, etc) for production: Folder usally like this: /home/username/public_html/ So, we should put like this:
Normally like this: Not Good: app1.example.com => point to => /home/username/app1.example.com/ Instead we use additional public folder: Good: app1.example.com => point to => /home/username/app1.example.com/public/ EDIT: it is also covered in the thread: https://forum.codeigniter.com/thread-76777.html That's it, hope it clear. RE: CI4 - Installation Location FOLDER example - Chris78 - 08-20-2020 Hi. In my host, there's the root directory in which I'm not allowed to upload files. It contains a htdocs repertory (the "public" folder) in which I'm supposed to put the files of my site ... Is there a solution to make a secure installation ? Thanks. RE: CI4 - Installation Location FOLDER example - jinbatsu - 08-20-2020 (08-20-2020, 08:00 AM)Chris78 Wrote: In my host, there's the root directory in which I'm not allowed to upload files. We should actually not touching anything outside from our username folder, including /root, /etc, /var,... So, example our folders from hosting provider, my username is jinbatsu, so usually look like this: /home/jinbatsu/public_html/ /home/jinbatsu/log/ /home/jinbatsu/mail/ /home/jinbatsu/temp/ ... So, we create new folder for our project CI4 files, example we name it the folder as project1. /home/jinbatsu/project1/app /home/jinbatsu/project1/system /home/jinbatsu/project1/writeable And public/* files from our CI4 we put to: /home/jinbatsu/public_html/* That's it. That's how we make our app and system outside from public_html (which is our default DOCROOT from hosting provider). RE: CI4 - Installation Location FOLDER example - Chris78 - 08-21-2020 Thanks for your reply. Problem is that I don't have any username folder ... Don't know how the host works, with cpanel, I go directly to a folder that contains htdocs (like public_html for you). Impossible for me to put anything outside this htdocs folder ! RE: CI4 - Installation Location FOLDER example - InsiteFX - 08-21-2020 (08-20-2020, 08:00 AM)Chris78 Wrote: Hi. Did you try uploading them using FTP? I'm on shared hosting with public_html And I can FTP my whole project to the root. If you have CPanel setup an FTP user and try it. RE: CI4 - Installation Location FOLDER example - Chris78 - 08-21-2020 Yes, I tried with FTP and I get "permission denied" either when I try to upload a file or to create a drectory ... RE: CI4 - Installation Location FOLDER example - jinbatsu - 08-26-2020 Can you upload a php script like this name it test.php, and see what printed out in browser? PHP Code: <?php My result example is: Here my folder: /home/xxx/public_html/ And what panel it is in your hosting? cPanel/Directadmin/Plesk or ? |