0

when i run command sudo /opt/lampp/lampp start

Starting XAMPP for Linux 7.1.11-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

My file location is /var/www/example/test.php

1 Answers1

0

In short, to access http://localhost/xampp within the default configuration of XAMPP you must:

  • Create a sub dir called xampp/ into the DocumentRoot directory. The default DocumentRoot of XAMPP is /opt/lampp/htdocs/ - source:

    sudo mkdir /opt/lampp/htdocs/xampp
    
  • Create a simple index.html or index.php file:

    echo '<?php phpinfo(); ?>' | sudo tee /opt/lampp/htdocs/xampp/index.php
    

    The above command will create index.php file in the directory /opt/lampp/htdocs/xampp/, that will contain the code: <?php phpinfo(); ?>.

If that works and you are able to see a page as this shown here, you must read the documentation of XAMPP and some relevant articles to gain a basic knowledge: How to setup a Virtual Host locally with XAMPP in Ubuntu.

pa4080
  • 29,831