Having permission problems with XAMPP

5,461

Simplest way:

  • Create a folder in your home folder called webroot (it can be called anything you like, but webroot or www would seem logical)
  • symlink the webroot folder in your home directory to the location of your xampp htdocs directory. sudo ln -s ~/webroot /path/to/xampp/htdocs
  • alternatively you can point the document root value (which i believe is found in httpd.conf - dont quote me on that, i only use xampp on windows and it may be different on linux) to point to the directory in your home folder.

You can then use the folder in your home directory as you would any other directory, since its in your home folder, and owned and created by you there shouldn't be any permissions problems. This will act as if you were placing the files in htdocs, so you can run php etc. files as you normally would. Ill also state that personally i use the lamp server available from the tasksel command, as i found theres generally more help available for this.

Share:
5,461

Related videos on Youtube

JohnB
Author by

JohnB

SOreadytohelp

Updated on September 17, 2022

Comments

  • JohnB
    JohnB over 1 year

    I installed xampp with no problems, and then ran the command to set security. Apparently setting security locks you out of the directories even at the file system level, not just via FTP - when I look at the permissions tab of my htaccess folder, for example, the owner is set to the ftp username. I can FTP, but unfortunately no matter what I set my default remote directory to in my FTP program, it takes me inside my htdocs folder and won't let me go up one level.

    Because this is a dev server installed on my local machine, I'd really like to be able to move files around at the file system level through my file manager, rather than having to FTP. How can I set the permissions on the folders in question, when my actual Linux username doesn't have write access to the folders? Is there some way I can do it in terminal with sudo? Does the sudo command override any permissions set on a folder or file that locks out the standard user?

  • JohnB
    JohnB over 13 years
    I've already posted on their forums, but I was looking for some clarification on Linux permissions in general to illustrate.
  • JohnB
    JohnB over 13 years
    That sounds like what I need, but I'm not sure I'm doing this correctly. I created the symlink as you indicated, to a folder in my home dir called www. I put an html file in that folder; now how do I get to that file in my browser? I tried localhost/test.html, but it gave me a 404.
  • richzilla
    richzilla over 13 years
    apologies, a minor typo on my part, your symlink should read: sudo ln -s ~/webroot/* /path/to/htdocs This will link the contents of the folder instead of the folder itself. Before you do this you will need to delete the original symlink from htdocs. either run unlink webroot or just delete it via nautilus
  • JohnB
    JohnB over 13 years
    Tried that; it's still giving me object not found. If I've put a file called linkTest.html in the webroot folder in my home folder, what URL should I be able to access it at?
  • richzilla
    richzilla over 13 years
    provided your xampp is running, it should be available at localhost/linkTest.html
  • JohnB
    JohnB over 13 years
    xampp is running, and that URL is not available. So obviously I did something wrong with the linking.