How To Install Nette PHP Framework on CentOS / RHEL / Fedora

Nette is a PHP Framework getting popularity world-wide. As per SitePoint’s survey Nette is 3’rd most popular PHP framework used for web development. This tutorial will help you to install Nette PHP Framework on CentOS, Red Hat & Fedora operating systems.

Step 1: Setup Yum Repositories

First you need to add REMI and EPEL rpm repositories in your system. these repositories have updated packages. Use one of the below command as per your OS version and system architecture.
CentOS/RHEL 7, 64 Bit System: 
# rpm -Uvh
# rpm -Uvh 

CentOS/RHEL 6, 32 Bit System: 
# rpm -Uvh
# rpm -Uvh 

CentOS/RHEL 6, 64 Bit System: 
# rpm -Uvh
# rpm -Uvh 

CentOS/RHEL 5, 32 Bit System: 
# rpm -Uvh
# rpm -Uvh

CentOS/RHEL 5, 64 Bit System: 
# rpm -Uvh
# rpm -Uvh

Step 2: Install Apache, MySQL and PHP

To start with Nette configuration, we first need to setup a running LAMP server. If you have already running LAMP stack skip this step else use followings commands to setup lamp stack.

Install Apache

# yum --enablerepo=remi,epel install httpd

Install MySQL

# yum --enablerepo=remi,epel install mysql-server
# service mysqld start
# /usr/bin/mysql_secure_installation

Install PHP

# yum --enablerepo=remi,epel install php php-mysql php-mcrypt
# service httpd restart

Step 3: Install or Update Composer

Composer is required for installing Nette framework. So use below commands to download and use as a command in our system.
# curl -sS | php
# mv composer.phar /usr/local/bin/composer
# chmod +x /usr/local/bin/composer
If you already have composer installed on your system. Use following command to update it to latest version.
# composer self-update

Step 4 – Create Nette Application

Let’s navigate to web document root and use composer to create a new nette application using following commands. It will automatically download latest copy of Nette framework on your system under mypp directory.
# cd /var/www/html
# composer create-project nette/sandbox myapp
After successfully downloading all packages, assign proper permissions on file and folders in your application.
# chown -R apache.apache myapp
# chmod -R 755 myapp
# chmod -R 777 myapp/tmp myapp/log

Step 5 – Access Nette Application

At this stage you have successfully configured Nette framework on your system.

Step 6 – Create Apache VirtualHost

Now add a Virtual Host in your Apache configuration file to access Nette PHP framework from web browser. To do it edit Apache configuration file /etc/httpd/conf/httpd.conf and add below code at end of file
# vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
       DocumentRoot /var/www/html/nette/www

       <Directory /var/www/html/nette/>
              AllowOverride All
Restart Apache service and access Nette framework using your favourite web browser and start developing a great web application.
 # service httpd restart

About Author:

I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Newer Post
Older Post


Post a Comment