1、Ubuntu 安装Apache
安装Apache
sudo apt-get install apache2修改端口号
打开 etc/apache2/port.config 修改 port 80重启Apache
service apache2 restart2、安装PHP
安装software-properties-common
apt-get install software-properties-common更换安装源
add-apt-repository ppa:ondrej/php更新源
sudo apt-get updateapt-get upgrade安装php7.0
apt-get install php7.03、测试
在 Apache var/www/ 目录下面新建 index.php文件,输入下面内容:
<?phpecho “Hello World”;?> 重启 Apache
service apache2 restart打开
http://localhost/index.php如果出现Hello World 说面安装成功。
UbuntuUbuntu安装Apache+PHP
原文地址:https://www.cnblogs.com/memorypro/p/9537853.html