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 yourusernameGroup 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 RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+
Pingback: XAMPP und Zugriffsrechte unter Mac « .crashsource
Much better than trying to change owner to “nobody”, will try it out tomorrow. Might delay my delusions of being Odysseus for a while.
Cool! That worked fine.
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…
Thanks a ton. This saves my countless seconds having to change permission on every new project!
Pingback: [osCmax V2.0.25] Localhost: problems with admin - images directory permissions and more...
Hello,
I have some problems with uploading images in WordPress (is wp-content/uploads writable). I was adviced to follow the steps above. However, my htppd.conf can’t be overwritten (only published). Any solution to this? And, is this the solution to be possible to upload images on my (local) WordPress site?
Looking forward to hearing from you.
Regards,
Iris
Hi,
Can you be more specific about what you mean with this:
However, my htppd.conf can’t be overwritten (only published). Any solution to this?
To be specific: I can’t make any changes in the this file
Edit /Applications/XAMPP/etc/httpd.conf:
I can only ‘read’ it
rgds
Hi,
I suggest you learn about UNIX file system permissions and sudo:
http://www.tech-recipes.com/rx/2754/os_x_edit_file_using_textedit_as_root_superuser/
Looked for ages for this – excellent fix