CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   localhost permissions (chmod) problem after moving to a new computer (http://www.codingforums.com/showthread.php?t=255747)

Juniper747 03-31-2012 04:13 PM

localhost permissions (chmod) problem after moving to a new computer
 
Background: I just moved all my localhost xampp files over to a brand new formatted computer, and now its having permissions issues.

So my code is faulting with this error:
Warning: chmod() [function.chmod]: Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/mysite.php on line 109. Where line 109 of my code is: chmod(image.jpg, 0777);

Here's what I tried:

I went into terminal and typed:
chmod -R 777 /applications/xampp

And that appeared to work fine (all the folders within xampp had the read & write permissions)... but I think the problem may have to do something with "chown". Because on my original computer, when I go to "get info" on the xampp folder I see: Home (Me), staff, everyone

But on the new computer I see: system, admin, everyone... So I am thinking that may be my issue? Is there something I have to change in my .ini files?

Any ideas? It's driving me nuts!

Inigoesdr 03-31-2012 04:24 PM

Use chown to set the owner to the user that Apache is running as.

Juniper747 03-31-2012 04:55 PM

how do I know what xampp is "running as"?

and what exactly would I type in at terminal to change chown... I am new at using terminal! Thanks so much.

leslie.jones 04-01-2012 08:29 PM

I take it this is xampp for Linux (as chmod/chown would be nonsensical on windows)

To find the user just issue, as root,
Code:

ps -aux | grep apache
Left hand column is user, you may have a couple running as root, but the majority will usually be running as 'nobody' or 'www-data'.

Code:

chown www-data:www-data
to change the user and group at the same time - you'll probably want to do the lot so:
Code:

chown -R www-data:www-data /path/to/directory/*
Or safer to do the directory itself, then cd in and issue:
Code:

chown -R www-data:www-data *

Juniper747 04-01-2012 08:36 PM

Thank you Leslie... it was a chown issue...

I ended up using the following after opening terminal as root (which I believe is the same thing you were telling me to do Leslie):


Permissions (to change ownership):

sudo chown -R nobody:admin /Applications/XAMPP/xamppfiles/htdocs
and then entered:
sudo chown -R nobody:admin /Applications/XAMPP/xamppfiles/var

Permissions (to change access level):

sudo chmod -R 777 /Applications/XAMPP/xamppfiles/htdocs

This ended up working.


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.