Sunday, November 07, 2010

OS X XAMPP permissions

Just a quick note to tone down my previous post about how easy is to move to a new OS X version.
As far as I can remember I hit this problem with 10.5 Leopard as well when using XAMPP.
The bottom issue was that the darn php is_writable and siblings were always complaining that they cannot read or write to the file system. Even after chmod 777 from the DocumentRoot up.

My solution is to change the user Apache runs under. The default is nobody:nogroup and this doesn't go well with OS X. So i just modified in /Applications/XAMPP/xamppfiles/etc/httpd.conf lines 138 and 139 adding my and "staff" as group. On 10.5 the group was named differently.  Just do an
id -p
in terminal and take the user name and first group name from there. Interesting group name choice from Apple for it's OS users. Staff :)

On a second thought maybe this is a start Apache OS X requirement that you should actually add a new apache user and edit the file. But I'm pretty ok with Apache running as me because I really want it to be able to access all my files. Well ahm, not all but I trust it'll stay inside it's DocumentRoots.

And please don't send me any exploits disguised as php tricks to run locally so you can own me :D


Blogger friguron said...

Sir, you, saved, my, life. Thanks.

10:45 AM, April 26, 2011  
Blogger aris said...

Thanks man. I knew about running httpd as a user process would fix my magento issue (localhost) but I did not remember how.

7:18 PM, November 19, 2012  

Post a Comment

<< Home