Welcome Guest, Not a member yet? Register   Sign In
Starter questions
#7

(11-21-2024, 10:35 AM)4usol Wrote: 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!
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:
  1. Adjust the Server Settings:
    If you have access to your hosting control panel (like cPanel or Plesk), check the PHP settings for
    Code:
    open_basedir
    and add your application paths to the allowed list. If you don’t have access, you may need to contact your hosting provider to request this change.
  2. Move Public Folder Files:
    Another way to solve this is to move the contents of the
    Code:
    public
    folder to the root directory (
    Code:
    httpdocs
    ). Be careful when doing this, and remember to:
    • Update
      Code:
      index.php
      to point to the correct paths for
      Code:
      Paths.php
      .
      php
      Copy code
      Code:
      $pathsPath = '../app/Config/Paths.php';
    • Ensure your
      Code:
      .htaccess
      file is updated and configured properly for the new structure.
  3. Alternative Configuration:
    Some hosting providers allow you to set a subdirectory (like
    Code:
    httpdocs/public
    ) as the domain root. This can work, but the open_basedir issue would still need to be addressed.
For Your Second Question:
Yes, there are starter packages and libraries for CodeIgniter that include features like user registration. You can check out:
  • CodeIgniter Shield: A comprehensive authentication and authorization library for CodeIgniter 4.
  • Community Add-ons: You’ll find plenty of third-party libraries or example repositories on GitHub with user authentication setups.
Why Cloudways Could Be a Great Fit
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.
  • One-Click Deployment: Install CodeIgniter and other PHP apps easily without dealing with complicated server configurations.
  • Performance-First Hosting: Built on top-tier providers like AWS and Google Cloud.
  • Security Built-In: Features like firewalls, Cloudflare CDN integration, and automatic backups keep your site safe.
Cloudways BFCM 2024 Deal
If you're considering trying a new host, now’s a great time:
  • 40% off for 4 months with the code BFCM2024.
  • 40 free migrations to help you switch without hassle.
  • Offer valid from November 7th to December 5th, 2024.
Alternatives to Explore
If you’re still exploring hosting options, you could also consider:
  • Hostinger: Affordable and beginner-friendly.
  • SiteGround: Great for managed hosting and support.
  • Namecheap: Budget-friendly with decent performance.
Let me know if you need more specific help with the configuration!
Reply


Messages In This Thread
Starter questions - by 4usol - 11-21-2024, 10:35 AM
RE: Starter questions - by InsiteFX - 11-21-2024, 11:25 PM
RE: Starter questions - by captain-sensible - 11-22-2024, 02:21 AM
RE: Starter questions - by 4usol - 11-22-2024, 11:05 PM
RE: Starter questions - by captain-sensible - 11-23-2024, 02:29 AM
RE: Starter questions - by 4usol - 11-23-2024, 05:50 AM
RE: Starter questions - by UmairHussain - 11-25-2024, 01:23 PM
RE: Starter questions - by captain-sensible - 11-26-2024, 03:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB