![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jun 2002
Location: france
Posts: 996
|
![]() anybody know what is the php code/function to make a folder and chmod to 777?
thx |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
You can try using the PHP ftp manipulation commands.
Thats one of the only wayts to make an CHMOD folders with PHP running is safe mode (at least that I know of)
__________________
Amen |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Join Date: Aug 2002
Posts: 1,844
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jul 2003
Location: East Village
Posts: 238
|
mkdir('this/folder', 0777);
ryan |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Aug 2002
Posts: 1,844
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | ||
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
Quote:
Yea but your username wont own those dirs. its not a good solution, You wont be able to del files or folders once you amke them. Quote:
PwN3d
__________________
Amen |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Jul 2003
Location: East Village
Posts: 238
|
not quite true
if you created it with a script, you can modify it with a script ryan |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
Quote:
__________________
Amen |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Mar 2002
Location: how'd I get here?
Posts: 264
|
No, he's right, if you create the directory in PHP running under apache, it'll be created with whatever usename Apache is running as. This means you'll be able to chmod or remove files from that directory in other scripts, since they will also be running as the same user.
If PHP's "safe_mode" is enabled all bets are off though. b.
__________________
[this signature intentionally left blank] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Jul 2003
Location: East Village
Posts: 238
|
![]() ryan |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: Los Angeles
Posts: 736
|
Quote:
before you try to flame, make sure you got the experience and knowledge under yer belt like buran. a knowledge of the way permissions works on unix systems is really easy to grasp once you read about it. if you do a mkdir through the web browser with a script it will be owned and have the same group as what apache is running on that server. that means that that user and group can do wahtaver it wants. which means that if you wrote another script to modify or delete that directory and you ran it throught he web browser it would run as user apache and would do waht you expect.
__________________
Tanguy 0x7a69 inc. Programmer/President/CEO http://www.0x7a69.com A Leader in Programming since 1996 PHP, Ruby on Rails, MySQL, PCI DSS, and any Technical Consulting |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
Quote:
You try it..... I have. It doesnt work. But maybe I'm running safe mode. I'm not flaming you fucking pile of stink. Your mother wears combat boots. PWNED.
__________________
Amen |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
|
Quote:
![]() jDoG
__________________
NSCash now powering ReelProfits.com ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash NOW OFFERING OVER 60 SITES CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Join Date: Mar 2002
Location: how'd I get here?
Posts: 264
|
Quote:
__________________
[this signature intentionally left blank] |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
|
Quote:
jDoG
__________________
NSCash now powering ReelProfits.com ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash NOW OFFERING OVER 60 SITES CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Sep 2003
Location: Las Vegas, NV
Posts: 350
|
Can't you just use shell_exec http://www.php.net/manual/en/function.shell-exec.php
and commands to change what needs to be changed? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
|
Quote:
It will do the same thing and create the directory with the same user apache is running as! jDoG
__________________
NSCash now powering ReelProfits.com ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash NOW OFFERING OVER 60 SITES CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
If you really need to run scripts as another user than the default Apache user.
Install suexec. Set User and Group in httpd.conf to the correct user. Install the CGI version of PHP, make sure it's NOT the CLI version. Rename your php scripts to .cgi Add " #!/usr/local/bin/php-cgi " or what ever you named the cgi version, at the top of your scripts. Voila! |
![]() |
![]() ![]() ![]() ![]() ![]() |