Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
The work-around is to create the directory outside of your web application from your regular account. Or if you are allowed to run cgi scripts and these are set up via cgiwrapper or suExec to run as your own user id, use this to create the directory. Once created with the right owner, you can manipulate it from your regular Apache-embedded PHP scripts. Thank you! I'm definitely filing this solution for later use. Meanwhile, I went back to trying the FTP_MKDIR method and found why that didnt work. I realized when accessing the website via ftp that the system path was different than the one displayed online. IE: my script path was shown as /home/virtual/site... while in my ftp client I was seeing /var/www/html... Changing my path references to the later one fixed everything...so far! Thanks for the help :) -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mkdir and rmdir possible but not readdir and opendir???
Hi, I'm having trouble understanding why I can create and delete directories with my script via mkdir and rmdir, but not simply being able to read them with opendir or readdir? For example, when I attempt to access these directories with opendir, I get this error message: Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 789 is not allowed to access... Safe Mode is on as I am hosted on a shared server and cannot change this. Surely there's a work-around for this? Any helpfull input would appreciated Thanks, -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mkdir and rmdir possible but not readdir and opendir???
Hi, I'm having trouble understanding why I can create and delete directories with my script via mkdir and rmdir, but not simply being able to read them with opendir or readdir? For example, when I attempt to access these directories with opendir, I get this error message: Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 789 is not allowed to access... Safe Mode is on as I am hosted on a shared server and cannot change this. Surely there's a work-around for this? Any helpfull input would appreciated Thanks, -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
On Saturday 28 February 2004 22:47, raisinlove wrote: Hi, I'm having trouble understanding why I can create and delete directories with my script via mkdir and rmdir, but not simply being able to read them with opendir or readdir? Are you saying that you can create a directory using mkdir() and then subsequently cannot read that directory using opendir()? For example, when I attempt to access these directories with opendir, I get this error message: Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 789 is not allowed to access... What directory are you trying to read? Safe Mode is on as I am hosted on a shared server and cannot change this. Surely there's a work-around for this? Surely if there is a work-around then safe mode would not be doing its job properly? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* War is an equal opportunity destroyer. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
This is normal. You are allowed to create the directory because the directory you are creating it in is owned by the same user id that owns the script calling mkdir(). However, since your web server runs as some other user the owner of the newly created dir will be that user and not your own so you subsequently cannot manipulate that directory. Same problem with safe mode and file uploads. ISP's are generally better off using open_basedir instead of safe-mode for this very reason. -Rasmus On Sat, 28 Feb 2004, raisinlove wrote: Hi, I'm having trouble understanding why I can create and delete directories with my script via mkdir and rmdir, but not simply being able to read them with opendir or readdir? For example, when I attempt to access these directories with opendir, I get this error message: Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 789 is not allowed to access... Safe Mode is on as I am hosted on a shared server and cannot change this. Surely there's a work-around for this? Any helpfull input would appreciated Thanks, -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
Rasmus Lerdorf wrote: This is normal. You are allowed to create the directory because the directory you are creating it in is owned by the same user id that owns the script calling mkdir(). However, since your web server runs as some other user the owner of the newly created dir will be that user and not your own so you subsequently cannot manipulate that directory. Same problem with safe mode and file uploads. ISP's are generally better off using open_basedir instead of safe-mode for this very reason. I see, so there's no way around this then. I'll inquire to my host why open_basedir couldnt be used instead of safe-mode. There's goes my plan of FTP-less website management :( thanks -steph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
Surely if there is a work-around then safe mode would not be doing its job properly? Well this was part of the purpose of my post, before Rasmus explained it, I didn't understand why I couldnt access a directory I had created. I was hoping for a function which would achieve the same purpose but wouldn't be affected by safe-mode. I've seen many other workaround solutions to other problems caused by the safe-mode setting. Unfortunatly this doesnt seem to be such a case. -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdir and rmdir possible but not readdir and opendir???
On Sat, 28 Feb 2004, raisinlove wrote: Surely if there is a work-around then safe mode would not be doing its job properly? Well this was part of the purpose of my post, before Rasmus explained it, I didn't understand why I couldnt access a directory I had created. I was hoping for a function which would achieve the same purpose but wouldn't be affected by safe-mode. I've seen many other workaround solutions to other problems caused by the safe-mode setting. Unfortunatly this doesnt seem to be such a case. The work-around is to create the directory outside of your web application from your regular account. Or if you are allowed to run cgi scripts and these are set up via cgiwrapper or suExec to run as your own user id, use this to create the directory. Once created with the right owner, you can manipulate it from your regular Apache-embedded PHP scripts. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php