Starter questions |
Hello,
I have now uploaded Codeigniter to the “httpdocs” folder on my web hosting for the first time. In the browser I now see mydomain.de/public, the welcome page. Now when I change the web hosting settings for the domain root to “httpdocs/public” I get this error “Warning: require(): open_basedir restriction in effect. File(/var/www/vhosts/mydomain/subdomain/httpdocs/app/Config/Paths.php) is not within the allowed paths:" What is the best way to solve this problem to get Codeigniter directly under the domain root without the "public" folder? By the way, a second question. Is there a standard package that includes user registration for example? Thanks!
CodeIgniter 4 Shield Auth
Shield Documentation What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
11-22-2024, 02:21 AM
(This post was last modified: 11-22-2024, 02:33 AM by captain-sensible. Edit Reason: more )
it looks like your app folder is basically accessible to public ; the only part of CI4 that should be accessible to the public ,is the contents of your public Ci4 folder. The rest should be at a level above that.
So if you have one site;the inside contents of public directory , should be in your hosting space; in another directory one level above hosting, that directory will contain everything else and you state that in the index.php file which will be at document route of your web hosting : Code: // LOAD OUR PATHS CONFIG FILE Joedoe.com.Then via cPanel and menu for hosting, where it says "manage domains " i add the domain "Joedoe.com . I go to cPanel and fiiddle with "add domains" and "sub domains" i edit path to document route of web in sub directory to point to the public directory inside the Joejoe.com directory, which itselrf is inside main hosting>There is no need to touch .htaccess or anything else.
Great, i solved the domain problem. Now i see the welcomepage directly under the domainname. All files/foldes now in the "httpdocs" but the domain point to "public", is it correct?
1) So i edit the app>config>database file. Is there a way to test the database connection? After that, i tried to setup the shield packages. I'm not firm with composer so i try to do it manually. 2) What will be the url to access the login page, i cannot find them? If i try to access "mydomain.tld/login" i get the message "No input file specified.". Update: i edit the htaccess file in the public folder like in the docu. Now i recieved "Can't find a route for 'GET: login'." if it enter mydomain.tld/login Also i don't understand the point in the documentation under "manual setup"-what i have to change in wich folder and files? Sorry to have so simple basic "newbie"-questions :-)
11-23-2024, 02:29 AM
(This post was last modified: 11-23-2024, 02:31 AM by captain-sensible. Edit Reason: as once jimminy cricket said - wait theres more )
if you have a web with for example the sort of structure
![]() Then in my cPanel i set the "document root" as subdomainDirectoryName/public. If you only have only one web , the inside contents of Ci4/public folder , without the directory will be inside your main web hosting , whic hwill be something like http . So there shouldn't be any directory called "public" in that case (11-23-2024, 02:29 AM)captain-sensible Wrote: if you have a web with for example the sort of structureVery helpful image. My situation is the red circle, there i have all folders including the "public" folder and this i defined as the root folder for the domain, i think it should be right. May you can help on the other questions, too?
(11-21-2024, 10:35 AM)4usol Wrote: Hello,For Your First Question: The error you’re seeing, “open_basedir restriction in effect”, typically happens because your hosting provider has restricted access to certain directories outside of the allowed paths. Here’s how you can solve it:
Yes, there are starter packages and libraries for CodeIgniter that include features like user registration. You can check out:
If you're experiencing configuration headaches with your current host, a managed hosting provider like Cloudways might save you time and effort. They offer dedicated environments optimized for PHP frameworks like CodeIgniter, and you won't have to deal with open_basedir restrictions since the platform is designed for flexibility.
If you're considering trying a new host, now’s a great time:
If you’re still exploring hosting options, you could also consider:
11-26-2024, 03:33 AM
(This post was last modified: 11-26-2024, 03:37 AM by captain-sensible. Edit Reason: the usual reasons )
with number 2) above by @UmairHussain then as he says, you want "the contents of the directory public" only (without the directory itself) . So from a command line if your on linux , you will change directory to inside of public eg
Code: [andrew@darkstar public]$ cd ~ Note the trailing "." end of last line. If you then upload , namezipfile.zip to the document root of your main hosting and extract, you will have the contents of public including the .htaccess file. What happends if your not careful is that you get the contents of public, with the directory called "public" to root of hosting which you dont want. if you have any trouble with the .htaccess then you can rename to htaccess , so you can easily see it, and just rename the file back to .htaccess using cPanel |
Welcome Guest, Not a member yet? Register Sign In |