ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Install Cakephp In Windows
    카테고리 없음 2020. 2. 16. 01:15
    Framework

    Many MVC based PHP frameworks are available now to make web developing tasks simpler and easier than before. In an MVC framework, there are three components which are Model, View and Controller. Models are used for accessing application data, Views are used for presenting data in the browser and Controllers are used for routing and handling user’s requests. These components are used to separate the tasks that help the developers to do web programming in a structured way. CakePHP is one of the well-known MVC framework that can be easily downloaded and installed without any cost. $ sudo systemctl start apache2.serviceOpen any web browser and type, and press enter to test Apache Server. The following information indicated that Apache server is working properly.Installing Database serverAlmost every web application uses database for storing, modifying and retrieving data.

    So you have to install any supported database server for storing project data. If you have installed MySQL or MariaDB server before then you can omit the next step. Run the command to update the system and install MariaDB server and client. $ cd /etc /apache2$ sudo nano apache2.confSearch for the location, ‘ ’ and change ‘AllowOverride None’ to ‘AllowOverride All’. Save the file and exit from the editor. This will set permission for.htaccess to override apache config on every directory.Now, your system is ready to run the command for installing cakePHP.

    At first, you have to select the folder where you want install CakePHP. Normally, public folder is selected for the installation which is ‘ /var/www/html’.

    You have to set read, write and execution permission for this folder. Run chmod command to set the permission.Now, restart apache server, go to this folder and run composer command to start the installation process of CakePHP. Suppose, you want to create a CakePHP project named ‘cakepro’. Run the commands to start the process for creating cakepro project. $ composer create-project -prefer-dist cakephp /app cakeproThe following message will appear when CakePHP installation starts. You have to wait for sometimes to complete the installation process.When the installation is approximately completed then the following message will appear. Press ‘y’ to give the permission.After completing the above steps, open a browser, type in the address bar and press enter.CakePHP project is ready to use now.

    Install Cakephp Composer Windows

    Windows

    Using Database in CakePHPCreate a new database named cakedb using mysql commands. Open the terminal and run the following command to make a connection with MariaDB server as root user. INSERT INTO employee SET empID = 101,LastName =’Arifin’,FirstName =’Mohammed’,Address =’Dhanmondi, Country =’Bangladesh’; INSERT INTO employee SET empID = 102, LastName = 'Yesmin', FirstName = 'Fahmida',Address = 'Mirpur', Country = 'Bangladesh'; INSERT INTO employee SET empID = 103, LastName = 'Rahman', FirstName = 'Shuvo',Address = 'Malibagh', Country = 'Bangladesh';Employee table is created with three records. When you will visit CakePHP site then you will notice that database connection is not working because MariaDB use unixsocket as plugin. So you have to change it to mysqlnativepassword. So run the following SQL statements to do the tasks.

    Install Cakephp Windows Iis

    $ sudo service mysql restart Setup Database Connection:Go to the location, / var/www/html/cakepro/config and create a copy of app.defaults.php file, named app.php. Open app.php and configure the database connection as below:Save the file and restart the server again. Go to the project URL. Now you will see the database is connected properly.Your next task is to create controllers, models and views to develop your project according to your requirements but that is for another tutorial.I hope you now see the power of CakePHP and are eager to learn more.

Designed by Tistory.