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?
在设置svn服务器时,我已经在我的raspberry pi(raspbian OS)上安装了apache2。现在我想添加一个运行php和mysql的Web服务器。如果不弄乱我的apache2上的任何现有配置,最好的方法是什么?
Would this be okay to execute on command line or is this package overwriting my existing apache2 install:
这可以在命令行上执行,或者这个包覆盖我现有的apache2安装:
$ sudo apt-get install php5-common libapache2-mod-php5 php5-cli
$ sudo apt-get install php5-common libapache2-mod-php5 php5-cli
The package in question is 'libapache2-mod-php5'.
有问题的包是'libapache2-mod-php5'。
Cheers
3 个解决方案
#1
0
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.
首先,我从未使用过Raspberry Pi,但会尝试给出答案。因为你只是为apache安装一个模块而你正在使用prefork编译版本(如果我没弄错的话,它仍然是默认的)。我认为配置不会有任何改变,也许只会添加一些规则来处理PHP文件。
To check if you're using Prefork, run this on command line (works on regular linux distributions):
要检查您是否正在使用Prefork,请在命令行上运行(适用于常规Linux发行版):
apache2 -l
If you can find prefork.c in the list, I guess you're safe.
如果你能在列表中找到prefork.c,我想你是安全的。
Please note that this is from personal experience with default unix distributions! I have never worked with Raspberry Pi (yet).
请注意,这是基于默认unix发行版的个人经验!我从未使用过Raspberry Pi(尚未)。
#2
0
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.
如果运行以下命令,将解析所有依赖项(它还将安装libapache2-mod-php5)。您可以在Peter Membrey和David Hows,Apress,2012年出版的“学习Raspberry Pi with Linux”一书中的第8章“自己的灯”中阅读关于LAMP安装的内容。
$ 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]?
#3
0
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
我想如果你安装php模块用于apache和php 5上面的apt-get命令将启用php支持apache但是这仍然取决于你正在使用的linux版本,因为php.ini中似乎有一些bug关于ubuntu(v10.04)中apache集成的文件,但ubuntu(v12.04)似乎没问题
#1
0
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.
首先,我从未使用过Raspberry Pi,但会尝试给出答案。因为你只是为apache安装一个模块而你正在使用prefork编译版本(如果我没弄错的话,它仍然是默认的)。我认为配置不会有任何改变,也许只会添加一些规则来处理PHP文件。
To check if you're using Prefork, run this on command line (works on regular linux distributions):
要检查您是否正在使用Prefork,请在命令行上运行(适用于常规Linux发行版):
apache2 -l
If you can find prefork.c in the list, I guess you're safe.
如果你能在列表中找到prefork.c,我想你是安全的。
Please note that this is from personal experience with default unix distributions! I have never worked with Raspberry Pi (yet).
请注意,这是基于默认unix发行版的个人经验!我从未使用过Raspberry Pi(尚未)。
#2
0
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.
如果运行以下命令,将解析所有依赖项(它还将安装libapache2-mod-php5)。您可以在Peter Membrey和David Hows,Apress,2012年出版的“学习Raspberry Pi with Linux”一书中的第8章“自己的灯”中阅读关于LAMP安装的内容。
$ 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]?
#3
0
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
我想如果你安装php模块用于apache和php 5上面的apt-get命令将启用php支持apache但是这仍然取决于你正在使用的linux版本,因为php.ini中似乎有一些bug关于ubuntu(v10.04)中apache集成的文件,但ubuntu(v12.04)似乎没问题