Daily Dairy

How to install Polr in Ubuntu 16.04

We can get the latest release of Polr from:


Please install the following packages that are required to run the polr

sudo apt-get install php-pdo
sudo apt-get install php-mysql
sudo apt-get install php-mbstring
sudo apt-get install php-tokenizer
sudo apt-get install php-json
sudo apt-get install php-curl

Open the directory /var/www/

cd /var/www/

Download the latest release in this directory

sudo wget https://github.com/cydrobolt/polr/archive/2.2.0.zip

Unzip the 2.2.0.zip

sudo unzip 2.2.0.zip

Rename the directory polr-2.2.0 to polr

sudo mv polr-2.2.0 polr

Now give it permissions

sudo chmod -R 755 polr

Also change the ownership

sudo chown -R www-data polr

Now download and install the composer locally in Polr directory

cd polr
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php
sudo php -r "unlink('composer-setup.php');"
sudo php composer.phar install --no-dev -o

To run Polr on Apache, you will need to create a new Apache configuration file.

cd /etc/apache2/sites-available/

Create a file polr.conf

sudo vim polr.conf

Add the following content to your file.

Replace example.com with your server’s external address and restart Apache when done.

ServerName example.com
ServerAlias example.com

DocumentRoot "/var/www/polr/public"

Require all granted
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

If mod_rewrite is not already enabled, you will need to enable it like so:

sudo a2enmod rewrite

Now add the polr.conf file to apache

I’m available for hire!

This is my email link: iamjagjeetubhi@gmail.com

sudo a2ensite polr.conf

Now reload the apache web server

sudo service apache2 restart

You must create a database for Polr to use before you can complete the setup script. To create a database for Polr, you can log onto your mysql shell and run the following command:


Once your server is properly set up, you will need to configure Polr and enable it to access the database.

cd /var/www/polr/

I’m available for hire!

This is my email link: iamjagjeetubhi@gmail.com

Copy the .env.setup file to .env in your website’s root directory.

sudo cp .env.setup .env

Now open your browser and open


You will see a polr setup page and fill the required fields.



1 thought on “How to install Polr in Ubuntu 16.04”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s