Content

Bitnami PHP Frameworks for Open Telekom Cloud

Some Bitnami stacks include PHP frameworks to simply development of PHP Web applications. Frameworks include CakePHP, CodeIgniter, Symfony, Laravel, Smarty and Zend Framework.

CakePHP

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 at http://SERVER-IP/cakephp.

Here is an example of what you might see:

Configuration

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

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.

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 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:

More Information

CodeIgniter

Overview

The CodeIgniter framework is installed in the frameworks/codeigniter directory in the installation directory. This directory includes an example application. Application configuration files are in the conf/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the htdocs/ 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/codeigniter/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 at http://SERVER-IP/codeigniter.

Here is an example of what you might see:

Configuration

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

To secure your application session, modify the encryption keys in the application/config/config.php file. Ideally, use a key that's 32 characters or longer in length.

$config['encryption_key'] = '';

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.

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

More Information

Laravel

Overview

The Laravel framework is installed in the frameworks/laravel directory in the installation directory. This directory includes an example application. Application configuration files are in the conf/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the public/ 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/laravel/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 at http://SERVER-IP/laravel.

Here is an example of what you might see (Laravel 4.x):

Here is an example of what you might see (Laravel 5.x):

Configuration

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

To start a new project, edit the file at /opt/bitnami/frameworks/laravel/app/routes.php (Laravel 4.x) or /opt/bitnami/frameworks/laravel/app/Http/routes.php (Laravel 5.x) and add a new route:

Route::get('my-first-route', function()
{
return 'Hello World!';
});

This will create the application route /my-first-route. To see this route in action, append this route to the application URL and visit it in your browser, such as http://SERVER-IP/laravel/index.php/my-first-route. If all is working correctly, you will see the output "Hello World!".

If your application will use a database, edit the database settings in the app/config/database.php (Laravel 4.x) or config/database.php (Laravel 5.x) file.

More Information

Smarty

Overview

The Smarty framework is installed in the frameworks/smarty directory of the installation directory. This directory includes two example applications, located in the sample/ and demo/ directories respectively.

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/smarty/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 at http://SERVER-IP/smarty.

Here is an example of what you might see:

To enable the second example application, follow these steps:

Edit the Apache configuration file at /opt/bitnami/frameworks/smarty/conf/httpd-prefix.conf and modify it to point to the demo/ directory, as shown below:

More Information

Symfony

Overview

The Symfony framework is installed in the frameworks/symfony directory in the installation directory. This directory includes an example application. Application code is in the app/ directory, application configuration files are in the conf/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the web/ 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/symfony/conf/httpd-prefix.conf"

Then, restart the Apache server.

$ sudo /opt/bitnami/ctlscript.sh restart apache

The Symfony application is configured by default to only allow requests originating from localhost for security reasons. As a result, you will see a message like You are not allowed to access this file. Check app_dev.php for more information when you try to access the example application on these platform.

To allow access to the example application from hosts other than localhost, edit the file /opt/bitnami/frameworks/symfony/web/app_dev.php and within it, disable the IP address check at the top of the file by commenting out the relevant lines. After modification, the relevant section of the file should look like this:

More Information

Zend Framework 2

Overview

The Zend Framework is installed in the frameworks/zendframework directory in the installation directory. This directory includes an example application. Application configuration files are in the config/ directory, application modules are in the module/ directory and public files, such as HTML pages, CSS and JavaScript files, images and other media assets are stored in the public/ 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/zendframework/conf/httpd-prefix.conf"