php
Posts: 37
Joined: Mon Jul 18, 2016 1:22 am

How to Get LAMP working on Raspberry Pi?

Mon Jul 18, 2016 3:12 am

I followed the instructions here for getting a LAMP (Linux, Apache, MySQL, PHP) on my RPi.

https://www.raspberrypi.org/learning/la ... worksheet/

Now when I visit localhost all I get is an "Index of" page. I tried to change the HTML file to a PHP file. I seemed to have messed something up.

I'm looking to learn PHP and MySQL on the Raspberry Pi. How do I fix this?

leiptrstormr
Posts: 60
Joined: Mon May 18, 2015 12:33 pm

Re: How to Get LAMP working on Raspberry Pi?

Mon Jul 18, 2016 4:22 am

You can check /etc/httpd/ or /etc/apache/ config file. The default to be displayed is called index.html. You can change this to whatever name you want in the config file. If you delete index.html, Apache will simply show an index of the files in Apache root folder.

php
Posts: 37
Joined: Mon Jul 18, 2016 1:22 am

Re: How to Get LAMP working on Raspberry Pi?

Mon Jul 18, 2016 4:32 am

Thanks.

I did delete index.html because that's what the guide says. I can just create a new one. Where do I put it?

leiptrstormr
Posts: 60
Joined: Mon May 18, 2015 12:33 pm

Re: How to Get LAMP working on Raspberry Pi?

Mon Jul 18, 2016 4:41 am

php wrote:Thanks.

I did delete index.html because that's what the guide says. I can just create a new one. Where do I put it?
The Apache root folder, or whichever folder is being displayed as index of. I want to say this is typically in /var/www

User avatar
rpdom
Posts: 18713
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to Get LAMP working on Raspberry Pi?

Mon Jul 18, 2016 4:51 am

leiptrstormr wrote: The Apache root folder, or whichever folder is being displayed as index of. I want to say this is typically in /var/www
On Jessie, the Apache root folder is /var/www/html

broe23
Posts: 902
Joined: Thu Jan 28, 2016 9:35 pm
Location: Central IL
Contact: Website

Re: How to Get LAMP working on Raspberry Pi?

Tue Jul 19, 2016 1:37 am

Setting up a LAMP server is the same with regular Debian. You will need to set it up with the Lite, no gui version. There are also config files in the /etc folder and sub-folders that have to be edited. The other thing that you need to also install is PHPmyadmin.

There are plenty of online guides out there on how to work with a LAMP server.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.

User avatar
rpdom
Posts: 18713
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to Get LAMP working on Raspberry Pi?

Tue Jul 19, 2016 5:21 am

broe23 wrote:You will need to set it up with the Lite, no gui version.
Why? It will work with the GUI version.
The other thing that you need to also install is PHPmyadmin.
I wouldn't say *need*. I only have PHPMyAdmin installed on one of my LAMP servers. It's just handy sometimes for manipulating databases if you don't want to do it from the command line or via another method.

php
Posts: 37
Joined: Mon Jul 18, 2016 1:22 am

Re: How to Get LAMP working on Raspberry Pi?

Tue Jul 19, 2016 2:15 pm

leiptrstormr wrote: On Jessie, the Apache root folder is /var/www/html
Yes, if you go to file manager you can access it.

http://www.php5dp.com/easy-writer-setup ... ry-pi-php/

broe23
Posts: 902
Joined: Thu Jan 28, 2016 9:35 pm
Location: Central IL
Contact: Website

Re: How to Get LAMP working on Raspberry Pi?

Wed Jul 20, 2016 3:08 am

rpdom wrote:
broe23 wrote:You will need to set it up with the Lite, no gui version.
Why? It will work with the GUI version.
The other thing that you need to also install is PHPmyadmin.
I wouldn't say *need*. I only have PHPMyAdmin installed on one of my LAMP servers. It's just handy sometimes for manipulating databases if you don't want to do it from the command line or via another method.
Servers do not need a GUI, since everything is going to be accessed either from the CLI through a remote SSH session with Putty or in the Terminal, or done through the folders.

Working with PHPmyadmin is better for those who are not too familiar with when working with servers. Less chance to screw something up.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.

php
Posts: 37
Joined: Mon Jul 18, 2016 1:22 am

Re: How to Get LAMP working on Raspberry Pi?

Thu Jul 21, 2016 2:44 am

Guess I'll install phpmyadmin.

The whole point of doing all this on the RPi is so that I don't screw up anything important and can learn. :)
broe23 wrote:Working with PHPmyadmin is better for those who are not too familiar with when working with servers. Less chance to screw something up.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: How to Get LAMP working on Raspberry Pi?

Thu Jul 21, 2016 3:17 am

broe23 wrote:Servers do not need a GUI, since everything is going to be accessed either from the CLI through a remote SSH session with Putty or in the Terminal, or done through the folders.

Working with PHPmyadmin is better for those who are not too familiar with when working with servers. Less chance to screw something up.
Mixed messages here; use CLI for the OS as that should be all you need, but a web GUI so that less familiar users won't screw up.

FWIW, in the ~30 years I've been in the industry, I've used the interface that works for me; horses for courses. For the most part I use the CLI (I'd use vi over leapad any day and the backup software I'm most familiar with is doesn't have a credible GUI - despite IBM's best efforts), but some things are just easier with a GUI (gparted being the one I use most on linux and storage management on windows).

I have 3 server class machines (various OSes), they are all headless, but all have have the GUI option installed as that provides the flexability I require.

Return to “General discussion”