If you are doing any kind of PHP development, you’ll almost always be using Apache along with it. Here’s the quick and easy way to get PHP up and running on your Ubuntu box.
如果您正在进行任何形式PHP开发,则几乎总是将Apache与之一起使用。 这是在您的Ubuntu机器上启动并运行PHP的快速简便的方法。
First, you’ll want to add the extra repositories to Ubuntu’s sources.list file.
首先,您需要将额外的存储库添加到Ubuntu的sources.list文件中。
From a command shell, you will run the following commands:
在命令外壳中,您将运行以下命令:
sudo apt-get install apache2
须藤apt-get install apache2
sudo apt-get install php5
须藤apt-get install php5
sudo apt-get install libapache2-mod-php5
须藤apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2重新启动
Note that if apache is already installed you can omit the first line. Your web files will now be found in /var/www/
请注意,如果已经安装了apache,则可以省略第一行。 您的网络文件现在可以在/ var / www /中找到
翻译自: https://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/