Spode
Posts: 14
Joined: Sun Oct 21, 2018 1:08 pm

Installing PHP using Raspbian & Nginx

Thu Oct 25, 2018 5:31 am

I am trying to use my Raspberry Pi as a web server, but got stuck when it said that php5-fpm and php-apc were not available.

I thought this was because there was a latest version available so I installed php7.0-fpm and no php-apc. When I got to the test.php portion of the tutorial I only ended up getting a 502 Bad Gateway.

How could I resolve this?

https://youtu.be/5eB-MtdFXlI

Does anyone know of a more updated tutorial for installing nginx, and php?

User avatar
DougieLawson
Posts: 38445
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Installing PHP using Raspbian & Nginx

Thu Oct 25, 2018 1:02 pm

I'm using PHP7.0 with NGINX & fcgiwrap. PHP5 is deprecated in Jessie and removed from stretch.

PHP7.0 with Apache2 is easier.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Spode
Posts: 14
Joined: Sun Oct 21, 2018 1:08 pm

Re: Installing PHP using Raspbian & Nginx

Thu Oct 25, 2018 3:21 pm

So how do I go about installing apache?

I thought nginx was used to save resources since the card is 32gb.

Do I need the php-apc thing mentioned in the video?

fruitoftheloom
Posts: 22557
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Installing PHP using Raspbian & Nginx

Thu Oct 25, 2018 3:43 pm

Spode wrote:
Thu Oct 25, 2018 3:21 pm
So how do I go about installing apache?

I thought nginx was used to save resources since the card is 32gb.

Do I need the php-apc thing mentioned in the video?


https://projects.raspberrypi.org/en/pro ... -wordpress
Rather than negativity think outside the box !

Asus ChromeBox 3 Celeron is my other computer.

Spode
Posts: 14
Joined: Sun Oct 21, 2018 1:08 pm

Re: Installing PHP using Raspbian & Nginx

Fri Oct 26, 2018 7:58 am

fruitoftheloom wrote:
Thu Oct 25, 2018 3:43 pm
Spode wrote:
Thu Oct 25, 2018 3:21 pm
So how do I go about installing apache?

I thought nginx was used to save resources since the card is 32gb.

Do I need the php-apc thing mentioned in the video?


https://projects.raspberrypi.org/en/pro ... -wordpress
This looks like it's only for WordPress websites. I don't want to host a WordPress website.

User avatar
buja
Posts: 555
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: Installing PHP using Raspbian & Nginx

Fri Oct 26, 2018 8:42 am

Spode wrote:
Fri Oct 26, 2018 7:58 am
fruitoftheloom wrote:
Thu Oct 25, 2018 3:43 pm
Spode wrote:
Thu Oct 25, 2018 3:21 pm
So how do I go about installing apache?

I thought nginx was used to save resources since the card is 32gb.

Do I need the php-apc thing mentioned in the video?


https://projects.raspberrypi.org/en/pro ... -wordpress
This looks like it's only for WordPress websites. I don't want to host a WordPress website.
There are several steps, you could stop after installing Apache and not go for the Wordpress bit.
Installing Apache is the same as installing any other standard package: use the package manager. Usually it's just a matter of finding the right package name.

Spode
Posts: 14
Joined: Sun Oct 21, 2018 1:08 pm

Re: Installing PHP using Raspbian & Nginx

Sun Oct 28, 2018 12:56 am

I just installed mysql-server and php-mysql but was I suppose to get a prompt asking me to setup a root password? Because I didn't get one and I have no idea how to log into mysql because there was no password set.

Is there a way to just uninstall everything on my RPi3?

Andyroo

Re: Installing PHP using Raspbian & Nginx

Sun Oct 28, 2018 1:17 am

Spode wrote:
Sun Oct 28, 2018 12:56 am
I just installed mysql-server and php-mysql but was I suppose to get a prompt asking me to setup a root password? Because I didn't get one and I have no idea how to log into mysql because there was no password set.

Is there a way to just uninstall everything on my RPi3?
Try either of these

Code: Select all

mysql -u root

sudo mysql -u root

User avatar
DougieLawson
Posts: 38445
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Installing PHP using Raspbian & Nginx

Sun Oct 28, 2018 11:36 am

Spode wrote:
Sun Oct 28, 2018 12:56 am
I just installed mysql-server and php-mysql but was I suppose to get a prompt asking me to setup a root password? Because I didn't get one and I have no idea how to log into mysql because there was no password set.

Is there a way to just uninstall everything on my RPi3?
DebIan stopped doing that with Stretch.

If you want a password protected MySQL (aka MariaDB) installation you have to jump through some hoops to disable the "root is allowed to login even if you don't want that" stuff.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”