Ubuntu: How to save projects file in htdocs [duplicate]


This question already has an answer here:

I am a php developer. I've been developing projects on a Windows system. Now I have completely switched to Ubuntu. I've installed XAMPP on my Ubuntu 16.04. I am not able to save my web files on htdocs as I used to save them in Windows before. My current default directory is opt/lampp/htdocs/. Is there a different way to handle the projects on a Linux system?


Follow these steps to get your projects setup:

  1. Create a users group called xamppusers:

    sudo groupadd xamppusers  
  2. Add yourself to that group:

    sudo usermod -a -G xamppusers $USER  
  3. Change the ownership of the /opt/lampp/htdocs folder:

    sudo usermod -R root.xamppusers /opt/lampp/htdocs  sudo chmod -R 775 /opt/lampp/htdocs  
  4. Restart the system

  5. Restart xampp:

    sudo /opt/lampp/lampp start  

To set up sample webpage:

  1. Create a document in htdocs:

    nano /opt/lampp/htdocs/info.php  
    • Add this content to it:

      <?php echo phpinfo(); ?>  
  2. Now in browser go to localhost/info.php, and you should see the output of that file.

With that if you have a projects you want to create that would in your case come with a folder the place that folder in htdocs like you use to on Windows and your good to go. From the xampp dashboard go to http://localhost/dashboard/howto.html for more information on running applications.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »