CakePHP

     

    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.

    Overview

    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 app/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the app/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/ctlscript.sh 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:

    cakephp.png


    Configuration

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

    1. To secure your application, modify the encryption keys in the app/Config/core.php file. Ideally, use a key that’s 32 characters or longer in length.

    Configure::write('Security.salt', '');
    Configure::write('Security.cipherSeed', '');
    

    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 app/Config/database.php.

    public $default = array(
            'datasource' => 'Database/Mysql',
            'persistent' => false,
            'host' => 'localhost',
            'port' => '3306',
            'login' => 'user',
            'password' => 'password',
            'database' => 'database_name',
            'prefix' => '',
            //'unix_socket' => '/opt/bitnami/mysql/tmp/mysql.sock',
            //'encoding' => 'utf8',
    );
    


    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.

    extension=php_pdo_pgsql
    

    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/app/webroot/"
    #Alias /cakephp/ "/opt/bitnami/frameworks/cakephp/app/webroot/"
    #Alias /cakephp "/opt/bitnami/frameworks/cakephp/app/webroot"
    Include "/opt/bitnami/frameworks/cakephp/conf/httpd-app.conf"
    
    • Edit the /opt/bitnami/frameworks/cakephp/app/webroot/.htaccess file so that the RewriteBase directive is set to the root URL:
    RewriteBase /
    
    • c. Restart the Apache server:
    $ sudo /opt/bitnami/ctlscript.sh 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 http://book.cakephp.org/

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    129642 view(s), 17 edit(s) and 7783 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
    cakephp.png
    CakePHP
    36.36 kB12:30, 2 Jan 2015vikramActions