Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

PHP mkdir() permission denied

General Tech Bugs & Fixes

Max. 2000 characters
Replies

usr_profile.png

User

( 5 months ago )

 

I've got a server setup with Centos 5.6, Apache 2.2.19 and PHP 5.2.17. PHP is being handled by suPHP.

In the global php.ini
safe_mode = off
open_basedir = none

Apache is set to run as nobody in the suPHP config.

I've got two domains setup in:
/home/user1/public_html and /home/user2/public_html

Both public_html directories have permissions of 0750 with group as nobody

All files/directories in each user directory are owned by that user and have the group set to that user as well.

I'm running a script in /home/user1/public_html/scripts/functions.php which is trying to create a directory in /home/user2/public_html/user_files (which has chmod permissions set to 0757), however I'm getting a permission denied error...

I'm assuming this is to do with the fact that PHP is being run as nobody, but I'm not sure what to change to enable scripts in each user's folder to write into the other user's folder, unless I make the user folder's writable by anybody, which doesn't sound very safe...

Does anybody know where I'm going wrong?

EDIT:

drwx--x--x    root.root      /home  
drwx-wx--x    user2.user2    /home/user2
drwxrwx---    user2.nobody   /home/user2/public_html 
drwxrwxrwx    user2.nobody   /home/user2/public_html/user_files

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif