[英]PhP local host redirecting to /var/www/html/index.php
I am using Ubuntu machine. 我正在使用Ubuntu计算机。 I am running lampp server for php files.
我正在运行Lampp服务器以获取php文件。
I have all my PHP files in my_folder
where I have all my codes in /opt/lampp/htdocs/my_folder
including index file in /opt/lampp/htdocs/my_folder/index.php
. 我所有的PHP文件都在
my_folder
,我的所有代码都在/opt/lampp/htdocs/my_folder
包括索引文件在/opt/lampp/htdocs/my_folder/index.php
。
I wanted to check my codes by running http://localhost/index.php
in Chrome browser, but for some reason it keeps directing me to /var/www/html/html.index
file. 我想通过在Chrome浏览器中运行
http://localhost/index.php
来检查代码,但是由于某些原因,它一直将我定向到/var/www/html/html.index
文件。 Can someone please help me resolve this problem? 有人可以帮我解决这个问题吗?
Thanks in advance. 提前致谢。
add this to you apache config. 将此添加到您的apache配置。
DocumentRoot /opt/lampp/htdocs/my_folder
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/lampp/htdocs/my_folder>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Adittionally, If MySQL doesn't start: 另外,如果MySQL无法启动:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/proftpd stop
sudo /opt/lampp/lampp start
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.