How to Install and Use CakePHP via Plesk GUI with PHP Composer Print

  • Cake PHP, PHP Composer, PhP ini
  • 0

Introduction:

CakePHP is a popular PHP framework that simplifies web application development. With Plesk and the PHP Composer extension, customers can easily install and manage CakePHP projects without needing to use the command line. This guide will walk you through the steps to set up CakePHP on your Plesk hosting environment.

 

Step 1: Log In to Plesk

  1. Access your Plesk control panel using your login credentials.

Step 2: Set Up a Domain or Subdomain

  1. Navigate to Websites & Domains.
  2. If you don’t already have a domain or subdomain set up where you want to install CakePHP, click Add Domain or Add Subdomain.
  3. Follow the prompts to create the domain or subdomain where you wish to install CakePHP.

Step 3: Access the PHP Composer Extension

  1. In Plesk, under Websites & Domains, select the domain where you want to install CakePHP.
  2. Click on PHP Composer from the available tools. If you don’t see it, make sure the PHP Composer extension is installed and activated.

Step 4: Install CakePHP Using Composer

  1. Create a New Project:

    • In the PHP Composer extension, click Install under Install Composer dependencies if prompted.
    • Choose Create a new Composer project.
    • In the Package name field, enter cakephp/app to install the latest version of the CakePHP application skeleton.
  2. Specify the Installation Directory:

    • Choose the appropriate directory where the project should be installed, such as /httpdocs or a subfolder.
  3. Run the Installation:

    • Click Install. Plesk will automatically execute the Composer command to download and install CakePHP in the specified directory.

Step 5: Configure the Database

  1. Create a Database:

    • Go to Databases in Plesk and add a new database for your CakePHP project.
    • Note down the database name, username, and password for later use.
  2. Edit the CakePHP Configuration:

    • Use the File Manager in Plesk to navigate to your CakePHP project directory.
    • Open the config/app_local.php file.
    • Update the database configuration in the file to match the database details you created:
       

Step 6: Set Folder Permissions

  1. Ensure the logs and tmp directories are writable by the web server.
  2. You can change the permissions using Plesk's File Manager:
    • Navigate to the logs and tmp directories.
    • Set the permissions to Writable for the web server user (usually www-data or apache).

Step 7: Test Your CakePHP Installation

  1. Open a web browser and navigate to the domain or subdomain where CakePHP was installed.
  2. If everything is set up correctly, you should see the default CakePHP welcome page.

Step 8: Manage CakePHP Using the PHP Composer Extension

  • The PHP Composer extension in Plesk allows you to manage your CakePHP project with ease.
  • You can run Composer commands such as install, update, or require directly from the Plesk GUI.
  • This approach helps to avoid using the command line, making it easier for beginners.

Troubleshooting

  1. Composer Error: PHP is not found
    Ensure that PHP is installed and configured correctly on your server. You can verify the PHP installation in Plesk by navigating to Tools & Settings > PHP Settings.

  2. Cannot Access PHP Composer Extension
    Make sure the PHP Composer extension is installed in Plesk. If not, you may need to install it through Plesk's Extensions Catalog.

  3. CakePHP Welcome Page Not Showing
    Verify that your domain is pointed correctly to the Plesk server and that the folder permissions for logs and tmp are set to writable.

Conclusion

Installing and managing CakePHP projects is straightforward with Plesk's PHP Composer extension.

This guide provides the steps needed to help you get started with your CakePHP project in just a few minutes.


Was this answer helpful?

« Back