How to deploy your CodeIgniter 4 project to production on Shared Hosting (cPanel)
This video demonstrates the common steps needed for your CodeIgniter 4 project to get ready for production deployment – in this instance, a shared hosting server equipped with cPanel. Although CodeIgniter Wizard is extensively mentioned throughout the demos, the solutions described here can be applied to almost any CodeIgniter4 project.
00:00 Intro
00:16 Prepare a copy of your CI4 project in Finder/Explorer
00:49 Edit the project in an IDE (e.g. VS Code)
01:40 Run the necessary ‘composer’ commands
04:16 Start preparing the Internet-facing web server
06:06 Upload public.zip to public_html
07:57 Upload the rest of the project folders & files
09:22 Edit public(_html)/index.php on the server
10:46 Show invisible files such as .htaccess
12:00 Turn on forcing of SSL connections
12:18 Prepare the MySQL database on the host
14:40 Enter the host server details in .env on PROD
15:36 Transfer the local DB tables and data to the host
16:40 See the CI4 web app live on the Internet
#CodeIgniterWizard ( creates Composer-based CI4 projects with the base framework libraries and files residing in the vendor directory and it includes the .env, composer.json and composer.lock files in the root of the project so that you can not only change the essential project configuration by simply editing the .env file in an editor, but also open the project root in a command-line terminal (or “Command Prompt” in Windows) and run composer commands.
The convenience of #PHP composer-based projects proves itself when it comes to adding 3rd-party libraries compatible with your project’s version or simply when you want to instantly change the version of the CodeIgniter framework – typically for upgrading it to the latest version with as fewest hassles ( as possible.
Although we are not sponsored by #A2Hosting ( we highly recommend them for the fact that they have the following amazing features:
– Drag and drop file manager to upload and decompress large archives on the server.
– Unlimited free SSL certificates (#LetsEncrypt) on most plans
– Your own Git-based remote version repository (you can commit cpanel.yaml files to directly publish your PHP project from your own remote repo!)
– Ability to run NodeJS, Python and Ruby apps via ‘Passenger’.
– Various automatic backup mechanisms for your files and databases.
– Support for both MySQL and Postgresql with unlimited table sizes unlike most shared hosting servers.
– A user-friendly GUI edit DNS records of your domains.
– Memcached server (among other advanced caching mechanisms)
– And more…
A2 Hosting
Blog Article of this very Video
CodeIgniter Wizard Product Page
CodeIgniter Wizard on the Mac App Store
The Making of the Demonstrated Web App
#CodeIgniter4 #CodeIgniter4ProductionDeployment
[ad_2]
source