Install WordPress on raspbian jessie – RCK

Proceed as pi.

Install WordPress

Download wordpress

cd /home/pi

If it exists, delete the WordPress directory:

rm -rf wp

Unzip wordpress

mv ./wordpress ./wp

Change owner to ‘www-data’

Nginx use the ‘www-data’ user and group.

sudo chown -R www-data:www-data wp

Granted to ‘pi’ user:

sudo chmod -R 775 wp
sudo usermod -a -G www-data pi

Group confirmation:

groups pi


pi : pi adm dialout cdrom sudo audio www-data video plugdev games users input netdev spi i2c gpio

Raspberry pi reboot:

sudo reboot

Modify the ‘wp-config.php’ file

cd ~/wp
cp wp-config-sample.php wp-config.php
sudo chown www-data:www-data wp-config.php
nano wp-config.php

Please edit this section(database name, ID, password):

/** The name of the database for WordPress */
define('DB_NAME', 'wp');

/** MySQL database username */
define('DB_USER', 'wp');

/** MySQL database password */
define('DB_PASSWORD', 'database password');

Please connect the site in a browser

http://raspberry pi IP address/

Add a user to MySQL

Install PHP7.0 on raspbian jessie – RCK

Proceed as pi.

Add new repository sources

sudo nano /etc/apt/sources.list

Add the following two lines:

deb jessie-backports main contrib non-free
#deb-src jessie-backports main contrib non-free

Next we need to add a couple of certificates in order to allow us to use the sources with apt-get. Run the following two commands:

sudo gpg --keyserver --recv-key CCD91D6111A06851
sudo gpg --armor --export CCD91D6111A06851 | sudo apt-key add -

Update the package list:

sudo apt-get install dirmngr
sudo apt-get update

PHP7.0 install

sudo apt-get install php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json  php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc php7.0-fpm

Connecting with nginx

sudo nano /etc/php/7.0/fpm/pool.d/www.conf

find the line

listen = /run/php/php7.0-fpm.sock

It should look like this:

listen =

Reboot raspberry pi.

sudo reboot

Excute the function phpinfo()

cd /home/pi/wp
nano pi.php

The contents of the file shoult look like this.


Connect to the page to the browser.

http://[rasberry pi IP]/pi.php

Install nginx on raspbian jessie – RCK

Proceed as pi.

Update the package list

sudo apt-get update

Install nginx

sudo apt-get install nginx openssl ssl-cert libapr1 libtool curl libcurl4-openssl-dev varnish

Changing the default config

cd /etc/nginx/sites-available
sudo mv default default.bak
sudo nano default

It should look like this:

upstream php-handler {
  #server unix:/var/run/php5-fpm.sock;
server {
  listen 80;
  # Path to the root of your installation
  root /home/pi/wp;
  client_max_body_size 20000M; # set max upload size
  fastcgi_buffers 64 4K;
  index index.php index.html;
  location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
    deny all;
  location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTPS off;
    fastcgi_pass php-handler;
  # Optional: set long EXPIRES header on static assets
  location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
    expires 30d;
    # Optional: Don't log access to assets
    access_log off;

Make Directory

mkdir /home/pi/wp
nano /home/pi/wp/index.html

It should look like this:

Start nginx

sudo service nginx start