在本地主机的Linux发行 [英] Localhost issue in Linux
问题描述
我试图运行在我的网页PHP文件,但是我有一些问题,与本地主机。
我已经安装的Apache2和PHP5(重新安装他们是肯定),我创建了一个 phpinfo.php的
在 /无功/网络文件/
以检查包含code单行我的本地主机:<?code>≤)PHP的phpinfo(; ?&GT;
。不过,我收到以下错误消息时,我尝试访问 HTTP://localhost/phpinfo.php
I was trying to run a php file on my webpage however I have some issues with localhost.
I have already installed apache2 and php5 (re-installed them to be sure) and I have created a phpinfo.php
file under /var/www/
in order to check my localhost containing a single line of code: <?php phpinfo(); ?>
. However I get the following error message when I try to access http://localhost/phpinfo.php
Forbidden
You don't have permission to access /phpinfo.php on this server.
当我试图运行须藤服务的Apache2重启
我得到以下回应:
When I'm trying to run sudo service apache2 restart
I get the following response:
- 重新启动Web服务器的apache2 AH00112:警告:DocumentRoot的[在/ var / WWW / HTTP]不存在AH00558:apache2的:无法可靠地
确定服务器的完全合格的域名,使用127.0.1.1。
全局配置服务器名称指令燮preSS此消息
什么是与本地主机的问题?
What's the problem with localhost?
此外我有一个问题。我有一个文件夹项目
下的一个项目(网页),其中包含的.php
和。 CSS
文件。我怎样才能让使用本地主机网页出现在我的网页浏览器?
Moreover I have one more question. I have a project (webpage) under a folder project
, that contains .php
and .css
files. How can I make the webpage appear in my web browser using localhost?
推荐答案
Ubuntu的最近改变了HTTP文件夹的/ var / www / html等
。也许你正在运行CentOS的,也许做了类似的事情。
Ubuntu recently changed the http folder to /var/www/html
. Maybe you are running centOS that perhaps did the something similar.
重新启动Web服务器的apache2 AH00112:警告:DocumentRoot的[ /无功/网络/ HTTP ]不存在
Restarting web server apache2 AH00112: Warning: DocumentRoot [/var/www/http] does not exist
所以,把你想在 /无功/网络/ HTTP
来,而不是服务于您的文件。并创建文件夹,如果它不存在。
So put your files you want to serve in /var/www/http
instead. And create the folder if it does not exist.
这篇关于在本地主机的Linux发行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!