Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 09-29-2006, 01:11 PM   #1
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.
Old 09-29-2006, 02:07 PM   #2
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: 78

If I am misunderstanding please explain your problem in more detail.
Old 09-29-2006, 03:15 PM   #3
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.
Old 09-29-2006, 06:22 PM   #4
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.


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 05:08 PM
Root privileges for user ar1 Linux - Security 2 01-07-2005 10:33 PM
mkdir in / with out being root Gustaf Slackware 5 10-21-2004 03:39 PM
How to mount without root privileges? ni0wn Slackware 3 09-15-2004 06:03 PM
root privileges and permissions evil_lafta Slackware 7 08-20-2003 10:37 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:38 AM.

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