php - 在 apache2 中访问 PHP 项目的问题
问题描述
我正在开发一个平台并且正在使用一个开源 php 项目,我从 github 克隆了它。所以,我遇到的主要问题是 Apache2,出于某种原因,即使我将包含我的 PhP 项目的文件放在 var/www/html 下,我指定了 apache 的配置文件来读取 php 索引,但它是不打开它。我得到的唯一结果是apache2的欢迎网页。PHP 工作得很好,因为我放在同一个 /html 中的 Phpmyadmin 和 php 测试网站也可以工作。我是否缺少 apache 中的配置设置?
我还为我的页面启用了一个自定义配置文件并将其添加到主机这里是我在 apache2 中启用的文件:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin admin@moritologon.com
ServerName moritologon.com
DocumentRoot /home/Sistema_php/online-food-ordering-system-in-php-master/
<Directory /home/Sistema_php/online-food-ordering-system-in-php-master/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
vim: 语法=apache ts=4 sw=4 sts=4 sr noet
解决方案
推荐阅读
- json - 使用 sed 提取 json 值
- cvxpy - cvxpy.Minimize(cvx.sum([cvx.abs(do somthing)...])) Problem.solver 返回一个负值
- javascript - 如何保存函数的输入值?
- javascript - 如何在电子应用程序中本地保存图像
- visual-studio - Visual Studio 对话框:您正在重命名脚本文件
- angular - 嵌入在 Angular 6 组件中的 iframe 中 Rocketchat 用户的自动登录
- excel - 删除 TEXTJOIN 和 IF 函数中的重复值
- c++ - 在两个 lambda 之间共享对象
- html - 如何在 Angular 7 上有一些延迟显示点击表单?
- ruby-on-rails - ActionController::UnknownFormat 在 CommentsController#index