Are you trying to install Kohana on Linux?
This guide will help you.
Kohana PHP Framework is an open source PHP software development framework that helps php developers to build web applications faster, and also, more effectively by providing them with a set of built-in objects/classes. It also enforces highly organized coding standards.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Linux related tasks.
In this context, you shall learn the steps to install Kohana on Linux.
Kohana is a web application development framework.
Also, it is a light framework that consists of many files that are scattered across carefully structured directories. In the end, these directories are transferred to the production server and used to run the web application.
Moreover, it offers many features that include:
i. Getting started with Kohana and setting up is easy.
ii. Also, it comes with commonly required additional tools or modules.
iii. Additionally, it offers the possibility to simply expand the defaults.
iv. You can build commercial applications with its BSD licensing and so on.
Here, you will see how easy it is to install Kohana.
For that, execute the following commands;
sudo yum install epel-release yum-utils -y
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
sudo yum-config-manager –enable remi-php70
sudo yum install php php-common php-opcache php-fpm php-zip php-mcrypt php-cli php-gd php-curl php-mysqlnd php-intl httpd* elinks -y
vi /etc/php.ini
cgi.fix_pathinfo=0
cd /var/www/html
wget https://github.com/kohana/kohana/releases/download/v3.3.1/kohana-v3.3.1.zip
unzip kohana-v3.3.1.zip
mv kohana-v3.3.1.zip /opt/
After this, the installation will be accessible from the WWW directory. So to test it, simply open your URL on a web browser.
http://localhost
or
http://ip
1. First, run the below to edit the bootstrapping file using the nano text editor.
nano application/bootstrap.php
2. Next, run the below to edit the timezone, set the locale, and to set the base application directory location.
# Find date_default_timezone_set and set your timezone
date_default_timezone_set('Europe/London');
# Find setlocale and set your locale
setlocale(LC_ALL, 'en_UK.utf-8');
# Find base_url and set the base application directory
# Relative to the base Apache directory (i.e. /var/www/my_app)
Kohana::init(array(
'base_url' => '/',
));
3. Now, enable the modules.
# Find Kohana::modules and uncomment them
Kohana::modules(array(
'auth' => MODPATH.'auth', // Basic authentication
'cache' => MODPATH.'cache', // Caching with multiple backends
'codebench' => MODPATH.'codebench', // Benchmarking tool
'database' => MODPATH.'database', // Database access
'image' => MODPATH.'image', // Image manipulation
'orm' => MODPATH.'orm', // Object Relationship Mapping
'oauth' => MODPATH.'oauth', // OAuth authentication
'pagination' => MODPATH.'pagination', // Paging of results
'unittest' => MODPATH.'unittest', // Unit testing
'userguide' => MODPATH.'userguide', // User guide and API documentation
));
4. Save the file and exit it by pressing CTRL+X and confirm with Y.
5. Now set the permissions of two of its folders so that it is writable.
$ sudo chmod -R a+rwx application/cache
$ sudo chmod -R a+rwx application/logs
6. Finally, enable and start service
$ sudo systemctl enable httpd
$ sudo systemctl start httpd
After bootstrapping the setup and configuring folder permissions, now you can test it by accessing the application in a web browser.
http://localhost
or
http://ip
Finally, after confirming everything is set correctly and working fine, you can remove the install.php file by running the below command.
rm -v install.php
This article will guide you on the easy steps to install and configure Kohana on Linux.