I setup my raspberry pi with lighttpd, php7 and magento. Unfortunately after unpack magento to /var/www/html I get an internal server error when open the webinterface setup.
This are the steps I did so far:
install lighttpd
apt install lighttpd -y
because PHP 7 is not available in jessie repo I get it from the new stretch repo:
echo "deb http://httpredir.debian.org/debian stretch main contrib non-free" | tee /etc/apt/sources.list.d/debian-stretch.list
apt install php7.0 php7.0-fpm -t stretch
rm /etc/apt/sources.list.d/debian-stretch.list
apt-get update -y
Next we need to enable fastcgi and tell Lighttpd where to find PHP.
tee /etc/lighttpd/conf-enabled/php.conf > /dev/null <<EOF
fastcgi.server += (".php" => ((
"socket" => "/var/run/php/php7.0-fpm.sock"
)))
EOF
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
/etc/init.d/lighttpd force-reload
install MySQL and create magento db with one user
apt-get install mysql-server
apt-get install mysql-client
mysql -u root -p
CREATE DATABASE magento;
CREATE USER magento_user@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON magento.* TO magento_user@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit
unpack magento. In winscp I copied the tar.gz file manually into /home/magento
mkdir /home/magento
tar xzvf /home/magento/Magento-CE-2.1.6-2017-03-29-01-08-05.tar.gz -C /home/magento
apt-get install rsync
sudo rsync -avP /home/magento/. /var/www/html/
opening website http://192.168.2.103 raises 500 internal server error.
see error log. I dont even know if these are the right errors...
cat /var/log/lighttpd/error.log
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: PHP message: PHP Fatal error: Uncaught Magento\Framework\Exception\FileSystemException: The file "/var/www/html/var/.regenerate" cannot be deleted Warning!unlink(/var/www/html/var/.regenerate): Permission denied in /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php:382
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: Stack trace:
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #0 /var/www/html/vendor/magento/framework/Filesystem/Directory/Write.php(172): Magento\Framework\Filesystem\Driver\File->deleteFile('/var/www/html/v...')
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #1 /var/www/html/vendor/magento/framework/Code/GeneratedFiles.php(98): Magento\Framework\Filesystem\Directory\Write->delete('/var/.regenerat...')
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #2 /var/www/html/vendor/magento/framework/App/ObjectManagerFactory.php(114): Magento\Framework\Code\GeneratedFiles->cleanGeneratedFiles()
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #3 /var/www/html/vendor/magento/framework/App/Bootstrap.php(385): Magento\Framework\App\ObjectManagerFactory->create(Array)
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #4 /var/www/html/vendor/magento/framework/App/Bootstrap.php(362): Magento\Framework\App\Bootstrap->initObjectManager()
2017-04-14 12:58:45: (mod_fastcgi.c.2702) FastCGI-stderr: #5 /var/www/html/vendor/magento/framewor...
I followed following tutorials to get so far:
After sitting here for whole day I found a way to get it working.
I achieved to install following on my raspberry pi 3:
This are the actions to do:
install lighttpd
apt install lighttpd -y
because PHP 7 is not available in jessie repo I get it from the new stretch repo:
echo "deb http://httpredir.debian.org/debian stretch main contrib non-free" | tee /etc/apt/sources.list.d/debian-stretch.list
apt install php7.0 php7.0-fpm apt php7.0-xml php7.0-curl php7.0-mcrypt php7.0-intl php7.0-mbstring php7.0-zip php7.0-gd php7.0-mysql -t stretch
rm /etc/apt/sources.list.d/debian-stretch.list
apt-get update -y
Next we need to enable fastcgi and tell Lighttpd where to find PHP.
tee /etc/lighttpd/conf-enabled/php.conf > /dev/null <<EOF
fastcgi.server += (".php" => ((
"socket" => "/var/run/php/php7.0-fpm.sock"
)))
EOF
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
/etc/init.d/lighttpd force-reload
magento needs mysql-5.6 or higher but currently it's not in the raspbian repo. With following code we will install version 5.7:
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqlclient-dev_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqlclient20_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqld-dev_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-client-5.7_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-client-core-5.7_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-server-5.7_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-server-core-5.7_5.7.17-1_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mecab/libmecab2_0.996-3_armhf.deb
wget http://ftp.debian.org/debian/pool/main/m/mysql-defaults/mysql-common_5.8+1.0.2_all.deb
wget http://ftp.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_armhf.deb
sudo apt install libaio1 libaio-dev libhtml-template-perl libevent-core-2.0-5
sudo dpkg -i libmecab2_0.996-3_armhf.deb
sudo dpkg -i liblz4-1_0.0~r131-2+b1_armhf.deb
sudo dpkg -i mysql-common_5.8+1.0.2_all.deb
sudo dpkg -i mysql-client-core-5.7_5.7.17-1_armhf.deb
sudo dpkg -i mysql-client-5.7_5.7.17-1_armhf.deb
sudo dpkg -i mysql-server-core-5.7_5.7.17-1_armhf.deb
sudo dpkg -i mysql-server-5.7_5.7.17-1_armhf.deb
apt-get update -y/
create magento db with one user (needed for later magento web installer)
mysql -u root -p
CREATE DATABASE magento;
CREATE USER magento_user@localhost IDENTIFIED BY 'password123';
GRANT ALL PRIVILEGES ON magento.* TO magento_user@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit
unpack magento. In winscp I copied the tar.gz file manually into /home/magento
mkdir /home/magento
tar xzvf /home/magento/Magento-CE-2.1.6-2017-03-29-01-08-05.tar.gz -C /home/magento
apt-get install rsync
sudo rsync -avP /home/magento/. /var/www/html/
http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html
chmod -R 777 /var/www/html
For me it was very helpful to open a second putty session and observing the lighttpd error.log to detect errors with following command:
tail -f /var/log/lighttpd/error.log
Please feel free to give advices to do better or faster.
Maybe someone can tell me how to fix my mistake with the permissions and set the right ones ;)
sources:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=162960,