Hello, friends. Besides Laravel we have other very efficient PHP frameworks. So in this post, you will learn how to install CakePHP on Debian 11. This framework although a bit simpler than Laravel is also very powerful and with it, we can create great web applications.
What is CakePHP?
CakePHP is a web application development framework written in PHP, built on the concepts of Ruby on Rails. As we know Ruby on Rails uses Ruby as a language but with development features that Cake wanted to implement in PHP. That is why we have a fast, agile, and above all efficient framework.
It is based on an MVC architecture. This guarantees that the logic of our solutions will be naturally separated from the data and presentation layers. This results in greater adaptability to changing customer needs. In addition, the framework has many conventions that make the workflow much lighter for the developer.
It can be said that CakePHP is a very pragmatic framework where conventions reign supreme over configurations. So, No complicated XML or YAML files. Just set up your database and you’re ready to work
Moreover, CakePHP is licensed under the MIT license which makes it perfect for use in commercial applications.
So, let’s install it on Debian 11 so you can use it without problems.
Install CakePHP on Debian 11
CakePHP requires Composer to tackle its installation smoothly. So, install Composer with our post.
How to install Composer on Debian 11?
After this, we can install some extra PHP modules that are needed by CakePHP.
php-zip php-intl php-pdo php-intl php-xml php-zip php-mbstring php-zip php-mbstring
You can install them all by running
sudo apt install php-zip php-intl php-pdo php-intl php-xml php-zip php-mbstring php-xml php-zip php-mbstring
Now with the help of Composer, you can run the following command and install CakePHP.
composer create-project --prefer-dist cakephp/app [project_name]
Remember that you have to specify the name of the project. In this case, I will create one called example
.
composer create-project --prefer-dist cakephp/app example
By executing the above command, Composer will start downloading all the CakePHP structure and dependencies.
This will also create a folder called example
where all the project structure will be.
Access it and make executable the bin/cake
file that will help us to run the project in developer mode.
To do this you have to run
bin/cake server
Also, you can specify a host and a port to listen on
bin/cake server -H [host] -p [port]
Then, open a web browser and go to the selected host and port and you will see the following screen
So, CakePHP is ready for battle.
Enjoy it.
Conclusion
Many developers consider CakePHP the best entry-level framework because of its ease of use and the speed at which we can see results. So CakePHP is not only this but a powerful framework capable of answering many needs.