LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-29-2006, 12:11 PM   #1
slam
Member
 
Registered: Mar 2003
Posts: 36

Rep: Reputation: 15
mkdir with root privileges


I am trying to create folders with a php website so users can login to an ftp session to drop files.
the script makes the directory but won't chown to the user name I want. the user name on the folder is apache.
What is the command for mkdir in php that will allow this chown as well.

I was looking for tips on using sudo for it but couldn't get it to work.
thanks
 
Old 09-29-2006, 01:07 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 77
chown?
http://www.php.net/manual/en/function.chown.php

If I am misunderstanding please explain your problem in more detail.
 
Old 09-29-2006, 02:15 PM   #3
slam
Member
 
Registered: Mar 2003
Posts: 36

Original Poster
Rep: Reputation: 15
I have been to that page before and it states that the superuser is the only one that has privleges to chown. However I should be able to sudo or something to give apache the right to chown the directory. or chmod it.

If I manually chown the folder to username then username can ftp to it.
I want to have my php script create the folders and chown (change the owner)them.
thanks
 
Old 09-29-2006, 05:22 PM   #4
slam
Member
 
Registered: Mar 2003
Posts: 36

Original Poster
Rep: Reputation: 15
I worked this out a different way.
Instead of directly running the command I put it in a batch script
then I run the batch file with
shell_exec ('sh /var/scriptname');

and now its working.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB HD Needs Root Privileges rrrssssss Linux - Hardware 3 11-13-2005 04:08 PM
Root privileges for user ar1 Linux - Security 2 01-07-2005 09:33 PM
mkdir in / with out being root Gustaf Slackware 5 10-21-2004 02:39 PM
How to mount without root privileges? ni0wn Slackware 3 09-15-2004 05:03 PM
root privileges and permissions evil_lafta Slackware 7 08-20-2003 09:37 PM


All times are GMT -5. The time now is 08:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration