Local XAMPP development and UNIX file permissions

If you are using XAMPP Apache+MySQL+PHP stack to develop web applications on your OSX or Linux computer you might want to fiddle with Apache settings to make your life easier.

By default XAMPP users nobody user for running Apache. If you try to load any file created by your normal system user Apache will give access denied error. This means that either you must make all PHP files readable for everyone, or change the file owner. This is painful if you need to repeat the process for every file.

Instead, it is easier to make XAMPP run under the permissions of your local user.

Edit /Applications/XAMPP/etc/httpd.conf:

<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
User yourusername
Group staff
</IfModule>
</IfModule>
<IfModule !mpm_winnt_module><IfModule !mpm_netware_module>
DocumentRoot "/Users/yourusername/yoursiteroot"

You also need to change the location of setting default folder execution rights htdocs location to your development location

#
# This has been changed from /Applications/XAMPP/htdocs
#
<Directory "/Users/moo/code/joomla/mobilejoomla_dev">
    Options Indexes FollowSymLinks ExecCGI Includes
   AllowOverride All
</Directory>

And now Apache will happily eat all files you create or edit.

 Subscribe to this blog in a reader Follow me on Twitter

4 thoughts on “Local XAMPP development and UNIX file permissions

  1. Pingback: XAMPP und Zugriffsrechte unter Mac « .crashsource

  2. Much better than trying to change owner to “nobody”, will try it out tomorrow. Might delay my delusions of being Odysseus for a while.

  3. Awesome!

    I’ve been looking for this information (EXACTLY), since yesterday, and you wouldn’t believe how hard it was to find a good answer…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>