Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Tuesday, 17 January 2017

No memory cache has been configured.


To fix this error make sure you have latest php5-apcu installed:

sudo apt-get install php5-apcu

edit config.php

sudo vi /nextcloud/config/config.php

add the following line in your directive

'memcache.local' => '\OC\Memcache\APCu',

restart the webserver

sudo service nginx restart

php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.

To fix this error edit php5-fpm config file

sudo vi /etc/php5/fpm/pool.d/www.conf

uncomment the following line


env[PATH] = /usr/local/bin:/usr/bin:/bin

and restart php5-fpm

sudo service php5-fpm restart

Thursday, 29 December 2016

RPI - Dynamic IP address

Create your own website using a Free Dynamic DNS service ( I used NoIP)

Once registered and installed the client on your Raspberry Pi you can create a startup script to automatically restart the client after a RPI reboot


  • Create a script in /etc/init.d/noip

# sudo vi /etc/init.d/noip

      copy and paste the following:

#! /bin/sh
# /etc/init.d/noip

### BEGIN INIT INFO
# Provides:     noip
# Required-Start: networking
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start noip at boot time
# Description: Start noip at boot time
### END INIT INFO

# . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc

DAEMON=/usr/local/bin/noip2
NAME=noip2
NOIP=`ps -ef|grep -q [n]oip2`
STATUS=$?

test -x $DAEMON || exit 0

case "$1" in
    start)
    echo -n "Starting dynamic address update: "
    start-stop-daemon --start --exec $DAEMON
    echo "noip2."
    ;;
    stop)
    echo -n "Shutting down dynamic address update:"
    start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
    echo "noip2."
    ;;

    restart)
    echo -n "Restarting dynamic address update: "
    start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
    start-stop-daemon --start --exec $DAEMON
    echo "noip2."
    ;;

    status)
        if [ ${STATUS} -eq "0" ];then
        echo "noip2 running..."
        else
        echo "noip2 Not running..."
        fi
    ;;

    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
esac
exit 0
  • Set exec permissions
# sudo chmod 755 /etc/init.d/noip
  • Add script to Startup/Shutdown
# sudo update-rc.d noip defaults

Raspberry Pi - quick update script


Quick and easy script to upgrade Raspberry Pi
#! /bin/bash

if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit 1
fi

#First Clean Up
echo "First Clean Up old downloaded and no longer required packages......."
apt-get clean
apt-get -y autoremove
echo "Clean Up Done"
echo ""

#Update package list
echo "Update your system's package list....."
apt-get update
echo "Package list updated"
echo ""

#Upgrade all installed packages
echo "Update all installed packages to latest versions....."
apt-get -y dist-upgrade

echo "Update Completed rebooting system...."
reboot