# Installing CakePHP manually

> Install the CakePHP framework by hand when you need a specific version or a custom setup on your hosting account.

Source: https://helpcenter.ruachost.com/apps/manual-installations/installing-cakephp-manually/

**CakePHP** is an open‑source PHP framework that simplifies web application development. While Softaculous can automate installation, you may sometimes need to install it manually for example, if you want a specific version or are working on an unmanaged server.

## Why Install CakePHP Manually?

- Greater control over version selection.
- Works on unmanaged servers without cPanel/Softaculous.
- Useful for developers who want custom setups.

## Steps to Install CakePHP Manually

1. **Download CakePHP.**

   - Visit cakephp.org and download the latest release `.zip` file.
2. **Extract Files.**

   - Unzip the downloaded package on your local computer.
   - The extracted folder will be named something like `cakephp-x.x.x`.
3. **Upload Files to Hosting Account.**

   - Use FTP or File Manager in cPanel to upload the contents of the extracted folder.
   - Place them in the `public_html` directory if you want CakePHP at the root (e.g., `example.com`).
   - Alternatively, upload to a subdirectory (e.g., `example.com/cakephp`).
   - On unmanaged servers, the document root may be `/var/www/html`.
4. **Create a MySQL Database and User.**

   - In cPanel, use the **MySQL Database Wizard**.
   - Or, on unmanaged servers, create a database and user from the command line.
   - Note the database name, username, and password.
5. **Configure Database Settings.**

   - Navigate to `app/Config/`.
   - Rename `database.php.default` to `database.php`.
   - Edit `database.php` and update:

     ```
     public $default = array(
       'datasource' => 'Database/Mysql',
       'persistent' => false,
       'host' => 'localhost',
       'login' => 'your_db_user',
       'password' => 'your_db_password',
       'database' => 'your_db_name',
       'prefix' => '',
     );
     ```
6. **Configure Security Settings.**

   - Open `app/Config/core.php`.
   - Update the following lines with unique values:

     ```
     Configure::write('Security.salt', 'random_string_here');
     Configure::write('Security.cipherSeed', 'numeric_digits_here');
     ```
   - Use a strong random string for `salt` and digits only for `cipherSeed`.
7. **Run the Installation.**

   - Open your browser and go to your domain (e.g., `http://example.com`).
   - The CakePHP default page should appear with green configuration messages.
   - If you see red error messages, check your database and configuration settings.
8. **Optional: Configure Test Database.**

   - In `database.php`, you can also configure a `$test` array for testing environments.
9. **Configure CakePHP Console (Optional).**

   - Log in via SSH.
   - Edit your `.bash_profile` to include the CakePHP console path:

     ```
     PATH=$PATH:$HOME/public_html/lib/Cake/Console
     export PATH
     ```
   - Run `source ~/.bash_profile` to apply changes.
   - Test by typing `cake` — you should see the CakePHP console welcome message.

> **Note:**
- CakePHP is compatible with all ruachost.com accounts.
- Always use strong admin and database passwords.
- Keep CakePHP updated to prevent vulnerabilities.
- Consider enabling automatic backups for added protection.
