duanlu1279 2017-01-03 05:48
浏览 329
已采纳

PhP本地主机重定向到/var/www/html/index.php

I am using Ubuntu machine. I am running lampp server for php files.

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.

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. Can someone please help me resolve this problem?

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • doudou20145 2017-01-03 05:51
    关注

    add this to you apache config.

    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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?