NOTE: This guide uses /opt/bitnami to refer to the installation directory for the Bitnami Stack. This is the default installation directory for Bitnami Cloud Hosting, Google Cloud Platform and Microsoft Azure servers and for virtual servers. If you're using a native installer and have installed the Bitnami Stack to a different folder, replace /opt/bitnami in the examples below with your actual installation directory.


    The CakePHP framework is installed in the frameworks/cakephp directory of the installation directory. This folder includes an example application. Application files are in the src/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the webroot/ directory.

    Activation and Testing

    To enable the example application, edit the Apache configuration file at  /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf and uncomment the following line

    Include "/opt/bitnami/frameworks/cakephp/conf/httpd-prefix.conf"

    Then, restart the Apache server.

    $ sudo /opt/bitnami/ restart apache

    You can now verify that the example application is working by visiting its URL using your browser. Select your platform below.

    Bitnami Cloud Hosting

    Access the example application via your browser at http://[server-IP-address]/cakephp

    Microsoft Azure / Google Cloud Platform

    Access the example application via your browser at http://[server-IP-address]/cakephp

    Virtual Machine

    Access the example application via your browser at http://[virtual-server-IP-address]/cakephp

    Native Installer

    Access the example application via your browser at http://localhost/cakephp (Windows) or http://localhost:8080/cakephp (Mac OS X and Linux).

    Tabs end

    Here is an example of what you might see:



    Before using the example application, here are a few important points to consider:

    1. To secure your application, modify the encryption salt in the config/app.php file. Ideally, use an alphanumeric akey that’s 32 characters or longer in length.

    'Security' => [
      'salt' => env('SECURITY_SALT', 'salt_here'),

    On Linux, you can use a command like pwgen 32 to generate a 32-character random key. On Windows, you can use a tool like PWGen.

    2. If your application will use a database, edit the database settings at config/app.php.

    'Datasources' => [
            'default' => [
                'className' => 'Cake\Database\Connection',
                'driver' => 'Cake\Database\Driver\Mysql',
                'persistent' => false,
                'host' => 'localhost',
                //'port' => 'non_standard_port_number',
                'username' => 'my_app',
                'password' => 'secret',
                'database' => 'my_app',
                //'unix_socket' => '/opt/bitnami/mysql/tmp/mysql.sock',
                'encoding' => 'utf8',
                'timezone' => 'UTC',
                'flags' => [],
                'cacheMetadata' => true,
                'log' => false,
                'quoteIdentifiers' => false,
                //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
                'url' => env('DATABASE_URL', null),

    NOTE: If you are using an operating system that supports sockets, such as Linux or Mac OS X, you can optionally specify the ‘unix_socket’ parameter in the above configuration array instead of the ‘host’ and ‘port’ parameters.

    MySQL support is already available by default. If you plan to use PostgreSQL, enable the php_pdo_pgsql extension in the /opt/bitnami/php/etc/php.ini file.


    To obtain access credentials for the MySQL database, use user 'root'. For the MySQL password, follow the steps below:

    Bitnami Cloud Hosting

    Google Cloud Platform

    • Browse to the Bitnami Launchpad for Google Cloud Platform dashboard and sign in if required using your Bitnami account.
    • Select the "Virtual Machines" menu item.
    • Select your Bitnami Stack server from the resulting list.
    • Obtain the password by selecting "Show" under "Credentials".

    Microsoft Azure

    To log in, use default password 'bitnami'.

    Virtual Machine

    To log in, use default password 'bitnami'.

    Native Installer

    The password is the one specified by you during the Bitnami Stack installation process.

    Tabs end

    3. To move the CakePHP example application such that it is available at the root URL of the server (without the /cakephp URL suffix), follow these steps:

    • Edit the /opt/bitnami/frameworks/cakephp/conf/httpd-prefix.conf file so that it looks like this:
    DocumentRoot "/opt/bitnami/frameworks/cakephp/webroot/"
    #Alias /cakephp/ "/opt/bitnami/frameworks/cakephp/webroot/"
    #Alias /cakephp "/opt/bitnami/frameworks/cakephp/webroot"
    Include "/opt/bitnami/frameworks/cakephp/conf/httpd-app.conf"
    • Edit the /opt/bitnami/frameworks/cakephp/webroot/.htaccess file so that the RewriteBase directive is set to the root URL:
    RewriteBase /
    • c. Restart the Apache server:
    $ sudo /opt/bitnami/ restart apache

    You should now be able to access the example application at the root URL of your server.

    More Information

    Learn more about developing applications with CakePHP at

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    145547 view(s), 21 edit(s) and 8264 character(s)


    You must login to post a comment.

    Attach file