当前位置:首页 > Linux > 正文内容

Debian系统简单配置Apache2+PHP

canca4年前 (2022-01-06)Linux768

环境说明

debian 8(jessie)apache2php 7.0

安装组件

# apt-get install apache2 php7.0-mysql libapache2-mod-php7.0 php7.0-mbstring

更改默认字符集

# nano /etc/apache2/conf-enabled/charset.conf
AddDefaultCharset UTF-8

修改apache的根目录DocumentRoot

# nano /etc/apache2/sites-enabled/000-default.conf
DocumentRoot /var/www

修改端口号

# nano /etc/apache2/ports.conf

修改site的配置文件

# nano /etc/apache2/sites-available/000-default.conf

开启apache 的rewrite功能

# a2enmod rewrite

启用Apache模块方法

# a2enmod

配置php7.0

# nano /etc/php/7.0/cli/php.ini

更改默认时区

# nano /etc/php/7.0/cli/php.ini
date.timezone = PRC

测试

# nano /var/www/info.php
<?php phpinfo(); ?>

访问

http://<your-server>/info.php


扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/794.html

标签: debianApachePHP
分享给朋友:

“Debian系统简单配置Apache2+PHP” 的相关文章

在Linux下安装和使用MySQL

一、引言   想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的 MySQL。本以为有Windows下使用SQL Server的经验,觉得在Linux下安装MySql应该是易如反掌的事,可在真正安装和使用MySQL时走了很多弯路,遇见很多问题,...

Determining IP Information for eth0...failed

虚拟机的网络采用NAT方式,始终不能上网,纠结了好几天的问题终于解决了。VM虚拟机中装了redhatlinux9.0,准备与主机共享文件,结果网络不通!       无法激活,在输入ifup eth0后总提示:  &nb...

如何通过Linux系统下iptables防火墙开启/关闭指定端口方法

一般情况下iptables已经包含在Linux发行版中.运行iptables --version来查看系统是否安装iptables 启动iptablesservice iptables startiptables --list //*查看iptables规则集*//下面是没有定义...

centos7 手动修改dns

方法一:vim /etc/resolv.conf# Generated by NetworkManager nameserver 114.114.114.114 nameserver 119.29.29.29重启网卡:systemctl ...

linux 系统tar文件压缩打包命令

打包成tar.gz格式压缩包# tar -zcvf renwolesshel.tar.gz /renwolesshel解压tar.gz格式压缩包# tar zxvf renwolesshel.tar.gz打包成tar.bz2格式压...

Debian更新系统时间

Debian更新时间A 更新源,并安装ntpdate:0.date 查看当前的系统时间1.sudo apt-get update 更新源2.sudo apt-get install ntpdate 安装ntpdate3.sudo ntpdate ntp1.aliyun....

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。