2

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.

dhruv jadia
  • 1,684
  • 2
  • 15
  • 28
MAPK
  • 5,635
  • 4
  • 37
  • 88

2 Answers2

3

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>
LF00
  • 27,015
  • 29
  • 156
  • 295
  • Thanks, it now redirects to the desired path only generating the actual code in the browser. It doesn't execute the codes. What could be the reason? – MAPK Jan 03 '17 at 06:01
  • Check you php by put the info.php in your rootpath, then access it. – LF00 Jan 03 '17 at 06:09
  • 1
    Thanks. This was the issue and the answer here fixed it: http://stackoverflow.com/questions/19533439/xampp-on-debian7-starting-apache-fails – MAPK Jan 03 '17 at 06:27
0

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
MAPK
  • 5,635
  • 4
  • 37
  • 88