PhP local host redirecting to /var/www/html/index.php

3.5k views Asked by At

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

There are 2 answers

3
LF-DevJourney On BEST ANSWER

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>
0
MAPK On

Adittionally, If MySQL doesn't start:

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/proftpd stop
sudo /opt/lampp/lampp start