24 thoughts on “Deploy CodeIgniter 4 to Shared Hosting (cPanel)

  1. Hey, Alex How do I change Robots.txt in the Public_html folder to get indexed in all search engines. My Home page only getting indexed. How do I index the pages inside the View folder? I am using Custome routes.

  2. hi alex lancer,
    I have uploaded the project of codeigniter 4 on the cpanel, the project has been uploaded but the error of database connection is showing.The database detail is set in the database.php file. The database detail is set in the .env file as well, yet there is an error. Can you do some help

  3. My shared hosting setup has multiple domains (mine) ALL under the public_html directory, each in their own subfolders.
    I have actually set my paths in the index.php file to point TWO levels up the file hierarchy to be above public_html. It didn't seem to like "../../<path>", so i explicitly set it from the root of my provider's system like this:$pathsPath = '/home/myAccount/CI_login/app/Config/Paths.php';
    This has also got me wondering whether some of my other domains, notably WordPress installs, might be exposing their config files since they, too, exist under public_html.
    Hmmm…

  4. All I really wanted was to use GroceryCRUD for some simple CRUD handling for my shitty PHP app.

    Instead I've spent hours trying to troubleshoot why Code Igniter, Composer and GroceryCRUD don't work on my cheap shared hosting. I hate how even simple PHP libraries require layers of other libraries to work. And of course all the documentation is out of date and contradicts documentation elsewhere.

    The funny part? Here's GroceryCRUD's installation instructions: "The installation is really easy. You just copy all the files to your project and you are ready to use grocery CRUD." 😂😂😂

  5. Thank you so much for sharing~
    I follow your step, I got a warning require ….. failed to open stream public_htmlindex.php on line 36, I don't know what is the problem ~

    Help me plz Mr Alex~~~~

  6. I deployed project on server, problem is that index.php file from root directory is running but after that bank screen is coming. After going to error_log there was this error
    "PHP Fatal error: Uncaught ErrorException: Cannot modify header information – headers already sent by (output started at path_to_root/app/Config/Events.php:27) in /path_to_root/vendor/codeigniter4/framework/system/Debug/Exceptions.php:164"
    I didn't know how to resolve it ?

  7. Hi.
    First of all, thanks for your nice videos.
    With my hosting provider, in cpanel, there's the root directory in which I'm not allowed to upload files. It contains a htdocs repertory (like public_html in your example) in which I'm supposed to put the files of my site … Is there a solution to make a secure installation ?

    Thanks.

  8. Absolutely love how you ended the video! 😀
    "And for all of you out there, echo this in h2", "Thank you for watching." 😀 😀 😀
    Thank you so much for sharing such valuable content. Your codeigniter 4 tutorials (login & OAuth examples, especially) are AMAZING!

  9. Hi Alex Thanks for making this video. this is helpfull.
    But I have a trouble when i call model in controller, the error is "Call to a member function functionName() on null"
    Could you like to help me?

  10. I completed the installation the same as your video but still get Whoops We seem to have hit a snag. The only difference is the name of the directory Codeigniter that I named with my project name but I changed also in index.php. Everything is fine in xamp localhost but not on the server. When you created the subdomain, did you redirected somewhere? I'm hosting with Hostgator. Isn't any change to do in .htaccess?

  11. Hi Alex, thanks for the help!!!

    You solve my problem. I have a channel on Youtube too where I publish videos about CodeIgniter 4 (in portuguese). Sorry if my english is not so good!!!

    Hugs from Brazil!!!

  12. Good morning Mr Alex, indeed you're a great tutor please I want to learn from you. Please kindly provide me your social media handles so that i can personally contact you

Leave a Reply

Your email address will not be published. Required fields are marked *