1
votes

I have already installed the apache2 on my raspberry pi (raspbian OS) when setting up a svn server. Now I want to add a web server running php and mysql. What is the best way to do this without messing with any existing configurations on my apache2?

Would this be okay to execute on command line or is this package overwriting my existing apache2 install:

$ sudo apt-get install php5-common libapache2-mod-php5 php5-cli

The package in question is 'libapache2-mod-php5'.

Cheers

3

3 Answers

0
votes

First of all, I've never worked with Raspberry Pi, but will try to give an answer. As you're only installing a module for apache and you're using the prefork compiled version (which is still default if I'm not mistaken). I think there will be no alterations in the configuration, perhaps only some rules will be added to handle PHP files.

To check if you're using Prefork, run this on command line (works on regular linux distributions):

apache2 -l

If you can find prefork.c in the list, I guess you're safe.

Please note that this is from personal experience with default unix distributions! I have never worked with Raspberry Pi (yet).

0
votes

If you run the following commands all the dependencies will be resolved (it will also install libapache2-mod-php5). You can read about LAMP install in Raspberry Pi in the chapter 8 "A LAMP of Your Own", of the book "Learn Raspberry Pi with Linux", by Peter Membrey and David Hows, Apress, 2012.

$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl libterm-readkey-perl tinyca
The following NEW packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 84 not upgraded.
Need to get 9,770 kB of archives.
After this operation, 91.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?
...
$ sudo apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5 php5-cli php5-common
0 upgraded, 7 newly installed, 1 to remove and 84 not upgraded.
Need to get 5,707 kB of archives.
After this operation, 16.3 MB of additional disk space will be used.
Do you want to continue [Y/n]?
0
votes

I think If you install php module for apache and php 5 with above apt-get command will enable the php support for apache but still this also depends on the linux version you are using on,because there seems to be some bugs in php.ini file on apache integration in ubuntu(v10.04) but ubuntu(v12.04)seems fine