Re: [PHP] MkDir Help

2008-10-22 Thread Yeti
If you are prior PHP5 write your own recursive mkdir function [1] as
posted on this list a while ago.

[1] http://marc.info/?l=php-general&m=121926660406116&w=2

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MkDir Help

2008-10-22 Thread Jim Lucas

Jason Todd Slack-Moehrle wrote:

Hi All,

I want to make a directory on my web server programatically when my code 
to create a new user runs.


I am running PHP 5.2.5 on Linux.

I am running:

$dirToCreate = "..".$_SESSION['s_USER_URL'];
mkdir($dirToCreate, 0777, TRUE); // create the directory for the user

$dirToCreate is: ../people/jason as an example

When I create this I am in /admin and I want to create 
/people/jason


/people already exists.

I get an error:

Warning: mkdir() expects at most 2 parameters, 3 given in
/home/net1003/public_html/admin/_createPage.inc on line 5

Even without TRUE< this operation does not work.

Does anyone have any thoughts?

-Jason



Along with what everybody else said.  echo out $dirToCreate and see if 
it is exactly what you expect it to be.  ../people/jason  Also, make 
sure that that directory doesn't already exist.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MkDir Help

2008-10-22 Thread Jason Todd Slack-Moehrle

Hi,


Well, as your mkdir is saying you can only have 2 parameters, I'm
guessing you're not yet running PHP 5. Also, as 0777 is the default
mode, you can omit this from your code to leave only one argument.

You didn't say the exact error you're getting when you omit the third
argument. My guess is it's a permission denied error, which is the  
most

common pitfall for file functions. Does Apache have access to your
wwwroot directory? Either make Apache the owner of the directory, add
the Apache group (the name varies from OS to OS, usually wwwrun, or  
www)
to the directory and allow group write permissions. You could chmod  
777
the directory, but this isn't very safe at all, and I doubt you'll  
find

anyone on this list who'd recommend it!


I will check all of this out and see what is going on.

Thanks!

-Jason


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MkDir Help

2008-10-22 Thread Ashley Sheridan
On Wed, 2008-10-22 at 16:33 -0700, Jason Todd Slack-Moehrle wrote:
> Hi All,
> 
> I want to make a directory on my web server programatically when my  
> code to create a new user runs.
> 
> I am running PHP 5.2.5 on Linux.
> 
> I am running:
> 
> $dirToCreate = "..".$_SESSION['s_USER_URL'];
> mkdir($dirToCreate, 0777, TRUE); // create the directory for the user
> 
> $dirToCreate is: ../people/jason as an example
> 
> When I create this I am in /admin and I want to create  
> /people/jason
> 
> /people already exists.
> 
> I get an error:
> 
> Warning: mkdir() expects at most 2 parameters, 3 given in
> /home/net1003/public_html/admin/_createPage.inc on line 5
> 
> Even without TRUE< this operation does not work.
> 
> Does anyone have any thoughts?
> 
> -Jason
> 
Well, as your mkdir is saying you can only have 2 parameters, I'm
guessing you're not yet running PHP 5. Also, as 0777 is the default
mode, you can omit this from your code to leave only one argument.

You didn't say the exact error you're getting when you omit the third
argument. My guess is it's a permission denied error, which is the most
common pitfall for file functions. Does Apache have access to your
wwwroot directory? Either make Apache the owner of the directory, add
the Apache group (the name varies from OS to OS, usually wwwrun, or www)
to the directory and allow group write permissions. You could chmod 777
the directory, but this isn't very safe at all, and I doubt you'll find
anyone on this list who'd recommend it!

Hope this helps.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MkDir Help

2008-10-22 Thread Stut

On 23 Oct 2008, at 00:33, Jason Todd Slack-Moehrle wrote:
I want to make a directory on my web server programatically when my  
code to create a new user runs.


I am running PHP 5.2.5 on Linux.

I am running:

$dirToCreate = "..".$_SESSION['s_USER_URL'];
mkdir($dirToCreate, 0777, TRUE); // create the directory for the user

$dirToCreate is: ../people/jason as an example

When I create this I am in /admin and I want to create  
/people/jason


/people already exists.

I get an error:

Warning: mkdir() expects at most 2 parameters, 3 given in
/home/net1003/public_html/admin/_createPage.inc on line 5

Even without TRUE< this operation does not work.

Does anyone have any thoughts?


Permissions. Does the web user have write access to wwwroot? Without  
it that function call will fail.


Also I don't think you're really running 5.2.5 since the recursive  
(3rd) parameter was added in 5.0. AFAIK the only way it would think  
mkdir takes no more than 2 parameters is if you're using an older  
version.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Wolf
> Nope, I have set mine to 755, and it does not seem to be giving me any 
> errors. This is the safer way to do it, right?
> 
> Alice

Alice,

At this point, you need to re-install the OS or prepare to get your machine 
completely hacked and trashed.  With your permissions that badly screwed up, it 
is only a matter of time before someone finds it and has their own ghost server.

First, go pick up a System Admin book for Redhat

Second, READ IT, Especially the parts on permissions and changing users

Third, Re-install the OS

Fourth, read the CLI vs. HTTP differences on programming languages you are 
using.  Obviously Perl and PHP are going to give you the same errors when using 
the HTTP and will operate differently from the CLI unless running as the same 
user.

This might even help your schooling.  Hopefully your classroom exercises are 
further along then these basic principles, but if not I have severe doubts in 
anyone graduating with an MIS from Indiana University.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Wei, Alice J.
> 
> From: Robert Cummings [EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2008 12:16 PM
> To: Wei, Alice J.
> Cc: Peter Ford; php-general@lists.php.net
> Subject: RE: [PHP] mkdir permission errors
>
> On Tue, 2008-07-15 at 08:16 -0400, Wei, Alice J. wrote:
> > This portion is to answer Rob's question:
> >
> > [EMAIL PROTECTED] var]# ls -la
> > total 92
> > drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
> > drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
> > drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
> > drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
> > drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
> > drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
> > drwxrwxrwx 35 root root 4096 2008-07-14 16:07 lib
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 local
> > drwxrwxrwx  5 root root 4096 2008-07-15 04:10 lock
> > drwxrwxrwx 17 root root 4096 2008-07-15 04:10 log
> > lrwxrwxrwx  1 root root   10 2008-06-24 08:24 mail -> spool/mail
> > drwxrwxrwx  6 root root 4096 2008-06-24 08:26 named
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 nis
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 opt
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 preserve
> > drwxrwxrwx 27 root root 4096 2008-07-14 16:12 run
> > drwxrwxrwx 13 root root 4096 2008-06-24 08:35 spool
> > drwxrwxrwx  2 root root 4096 2008-07-14 16:10 tmp
> > drwxrwxrwx  8 root root 4096 2008-07-14 16:07 www
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:29 yp
>
> Umm... all your base are bel^H^H^H^H^H^H^H^H^H^H^H^H
>
> Umm, you've made your entire system world readable/writeable? That's not
> good. And the ownership of www is root, not apache. Change directory to
> www and do ls -al again. Maybe your html directory is ok for ownerships.
>
> > And does your PHP script have the correct path?
> >
> > This is the latest error I got:
> >
> > Warning: mkdir() [function.mkdir]: Permission denied in 
> > /var/www/html/file_linux.php on line 15
> > Cannot create directory
>
> The error indicates what script is generating the error. Not the path to
> the directory you want to create. Maybe echo the name of the directory
> you are trying to create when you get a failure for mkdir().
>
> Nope, I have set mine to 755, and it does not seem to be giving me any 
> errors. This is the safer way to do it, right?

755 are better permissions in general than 777, but to what does "mine"
refer in the above context?

I  meant the permission settings have been set to 755 and no longer 777.
My mail client? All I can think of is when I am reading others posts and try to 
answer what they are asking for, which makes it seem like there is a lag.

Alice

Cheers,
Rob.

Ps. what's wrong with your mail client? It doesn't quote content to
which you reply making it difficult to see where the previous person's
post ends and your response begins.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Robert Cummings
On Tue, 2008-07-15 at 12:19 -0400, Wei, Alice J. wrote:
> 
> From: Robert Cummings [EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2008 12:16 PM
> To: Wei, Alice J.
> Cc: Peter Ford; php-general@lists.php.net
> Subject: RE: [PHP] mkdir permission errors
> 
> On Tue, 2008-07-15 at 08:16 -0400, Wei, Alice J. wrote:
> > This portion is to answer Rob's question:
> >
> > [EMAIL PROTECTED] var]# ls -la
> > total 92
> > drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
> > drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
> > drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
> > drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
> > drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
> > drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
> > drwxrwxrwx 35 root root 4096 2008-07-14 16:07 lib
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 local
> > drwxrwxrwx  5 root root 4096 2008-07-15 04:10 lock
> > drwxrwxrwx 17 root root 4096 2008-07-15 04:10 log
> > lrwxrwxrwx  1 root root   10 2008-06-24 08:24 mail -> spool/mail
> > drwxrwxrwx  6 root root 4096 2008-06-24 08:26 named
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 nis
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 opt
> > drwxrwxrwx  2 root root 4096 2008-04-07 17:44 preserve
> > drwxrwxrwx 27 root root 4096 2008-07-14 16:12 run
> > drwxrwxrwx 13 root root 4096 2008-06-24 08:35 spool
> > drwxrwxrwx  2 root root 4096 2008-07-14 16:10 tmp
> > drwxrwxrwx  8 root root 4096 2008-07-14 16:07 www
> > drwxrwxrwx  3 root root 4096 2008-06-24 08:29 yp
> 
> Umm... all your base are bel^H^H^H^H^H^H^H^H^H^H^H^H
> 
> Umm, you've made your entire system world readable/writeable? That's not
> good. And the ownership of www is root, not apache. Change directory to
> www and do ls -al again. Maybe your html directory is ok for ownerships.
> 
> > And does your PHP script have the correct path?
> >
> > This is the latest error I got:
> >
> > Warning: mkdir() [function.mkdir]: Permission denied in 
> > /var/www/html/file_linux.php on line 15
> > Cannot create directory
> 
> The error indicates what script is generating the error. Not the path to
> the directory you want to create. Maybe echo the name of the directory
> you are trying to create when you get a failure for mkdir().
> 
> Nope, I have set mine to 755, and it does not seem to be giving me any 
> errors. This is the safer way to do it, right?

755 are better permissions in general than 777, but to what does "mine"
refer in the above context?

Cheers,
Rob.

Ps. what's wrong with your mail client? It doesn't quote content to
which you reply making it difficult to see where the previous person's
post ends and your response begins.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Wei, Alice J.

From: Robert Cummings [EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 12:16 PM
To: Wei, Alice J.
Cc: Peter Ford; php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

On Tue, 2008-07-15 at 08:16 -0400, Wei, Alice J. wrote:
> This portion is to answer Rob's question:
>
> [EMAIL PROTECTED] var]# ls -la
> total 92
> drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
> drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
> drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
> drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
> drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
> drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
> drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
> drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
> drwxrwxrwx 35 root root 4096 2008-07-14 16:07 lib
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 local
> drwxrwxrwx  5 root root 4096 2008-07-15 04:10 lock
> drwxrwxrwx 17 root root 4096 2008-07-15 04:10 log
> lrwxrwxrwx  1 root root   10 2008-06-24 08:24 mail -> spool/mail
> drwxrwxrwx  6 root root 4096 2008-06-24 08:26 named
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 nis
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 opt
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 preserve
> drwxrwxrwx 27 root root 4096 2008-07-14 16:12 run
> drwxrwxrwx 13 root root 4096 2008-06-24 08:35 spool
> drwxrwxrwx  2 root root 4096 2008-07-14 16:10 tmp
> drwxrwxrwx  8 root root 4096 2008-07-14 16:07 www
> drwxrwxrwx  3 root root 4096 2008-06-24 08:29 yp

Umm... all your base are bel^H^H^H^H^H^H^H^H^H^H^H^H

Umm, you've made your entire system world readable/writeable? That's not
good. And the ownership of www is root, not apache. Change directory to
www and do ls -al again. Maybe your html directory is ok for ownerships.

> And does your PHP script have the correct path?
>
> This is the latest error I got:
>
> Warning: mkdir() [function.mkdir]: Permission denied in 
> /var/www/html/file_linux.php on line 15
> Cannot create directory

The error indicates what script is generating the error. Not the path to
the directory you want to create. Maybe echo the name of the directory
you are trying to create when you get a failure for mkdir().

Nope, I have set mine to 755, and it does not seem to be giving me any errors. 
This is the safer way to do it, right?

Alice

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Robert Cummings
On Tue, 2008-07-15 at 08:16 -0400, Wei, Alice J. wrote:
> This portion is to answer Rob's question:
> 
> [EMAIL PROTECTED] var]# ls -la
> total 92
> drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
> drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
> drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
> drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
> drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
> drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
> drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
> drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
> drwxrwxrwx 35 root root 4096 2008-07-14 16:07 lib
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 local
> drwxrwxrwx  5 root root 4096 2008-07-15 04:10 lock
> drwxrwxrwx 17 root root 4096 2008-07-15 04:10 log
> lrwxrwxrwx  1 root root   10 2008-06-24 08:24 mail -> spool/mail
> drwxrwxrwx  6 root root 4096 2008-06-24 08:26 named
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 nis
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 opt
> drwxrwxrwx  2 root root 4096 2008-04-07 17:44 preserve
> drwxrwxrwx 27 root root 4096 2008-07-14 16:12 run
> drwxrwxrwx 13 root root 4096 2008-06-24 08:35 spool
> drwxrwxrwx  2 root root 4096 2008-07-14 16:10 tmp
> drwxrwxrwx  8 root root 4096 2008-07-14 16:07 www
> drwxrwxrwx  3 root root 4096 2008-06-24 08:29 yp

Umm... all your base are bel^H^H^H^H^H^H^H^H^H^H^H^H

Umm, you've made your entire system world readable/writeable? That's not
good. And the ownership of www is root, not apache. Change directory to
www and do ls -al again. Maybe your html directory is ok for ownerships.

> And does your PHP script have the correct path?
> 
> This is the latest error I got:
> 
> Warning: mkdir() [function.mkdir]: Permission denied in 
> /var/www/html/file_linux.php on line 15
> Cannot create directory

The error indicates what script is generating the error. Not the path to
the directory you want to create. Maybe echo the name of the directory
you are trying to create when you get a failure for mkdir().

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-15 Thread Robert Cummings
On Tue, 2008-07-15 at 09:06 +0100, Peter Ford wrote:
> Wei, Alice J. wrote:
> > Hi, Rob:
> > 
> >   I forgot to mention that I have been using yum install.
> >   I have reinstalled the entire thing, put back all the packages, and then 
> > I went to /var and did a chmod -R 777 var, and then did a
> > 
> >[EMAIL PROTECTED] var]# chown -R apache:apache .
> > 
> > Interestingly, I do not see anything different, and I still get this error 
> > that says my permission is denied. Here is my
> > 
> > [EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
> > root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 
> > /usr/sbin/httpd
> > apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 
> > /usr/sbin/httpd
> > apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 
> > /usr/sbin/httpd
> > root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
> > apache|httpd
> > 
> > Obviously, my last one has already changed the owner to apache 
> > already.Nevertheless, I am still denied even when I am now logged in as 
> > root. Is this anything with firewalls?
> > 
> 
> Hang on a minute: you're original message said the error was:
> 
> Warning: chmod() [function.chmod]: Permission denied in 
> /usr/local/apache/htdocs/file_linux.php on line 27
> 
> But you say you've re-installed, and done "chmod -R 777 var" and "chown -R 
> apache:apache ." in /var

As Scooby would say... "Ruh, Roh!".

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-15 Thread Wolf
 Daniel Brown <[EMAIL PROTECTED]> wrote: 
> On Tue, Jul 15, 2008 at 7:05 AM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
> >
> > Do I really have to reinstall the entire Fedora?
> 
> You may be a prime candidate for Windows.

Well, you *could* load Fedora on another machine, fully update it, and then go 
into / and do an ls -alF.
THEN, on the machine that you have completely messed up the permissions on, you 
would go to / and do an ls -alF

Then traverse the directory structures simultaneously on both machines and make 
sure the one you messed up matches the pristine installed one.

Once you have done that, you should be OK.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-15 Thread Daniel Brown
On Tue, Jul 15, 2008 at 7:05 AM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
>
> Do I really have to reinstall the entire Fedora?

You may be a prime candidate for Windows.

-- 

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-15 Thread Peter Ford

Wei, Alice J. wrote:


From: Peter Ford [EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 7:28 AM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:

-Original Message-
From: Peter Ford [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 4:06 AM
To: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:

Hi, Rob:

  I forgot to mention that I have been using yum install.
  I have reinstalled the entire thing, put back all the packages, and then I 
went to /var and did a chmod -R 777 var, and then did a

   [EMAIL PROTECTED] var]# chown -R apache:apache .

Interestingly, I do not see anything different, and I still get this error that 
says my permission is denied. Here is my

[EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
apache|httpd

Obviously, my last one has already changed the owner to apache 
already.Nevertheless, I am still denied even when I am now logged in as root. 
Is this anything with firewalls?


Hang on a minute: you're original message said the error was:

Warning: chmod() [function.chmod]: Permission denied in
/usr/local/apache/htdocs/file_linux.php on line 27

But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
apache:apache ." in /var

A few things there:
When you are changing permissions and ownerships on such a large scale, you
should always use absolute paths to be sure you are doing the right thing - like
"chmod -R 777 /var" and "chown -R apache:apache /var"

Next, changing permission and ownership recursively on something like /var is
likely to wreck your system in weird and wonderful ways, and is pretty difficult
to undo - you might be looking at a total OS reinstall here (once you've solved
your Apache problems)

Finally, the error message refers to a file in /usr/local/apache/htdocs, but you
then are changing permissions in /var - where is your web root?! It looks like
your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
files are actually in /var/something...

I forgot to mention that I use Fedora on a Linux machine. I used yum install 
apache and yum install php to install my packages. Therefore, I don't have a 
/usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
originally I do have /usr/local/apache/htdocs that I configured during previous 
installations. This is not there anymore after my reinstallations since 
yesterday.

Do I really have to reinstall the entire Fedora? I hate to say that my scripts 
worked fine BEFORE yesterday until the power went out and nothing went right 
after I have restarted the entire system.

Alice



You don't *have* to reinstall Fedora (yet) - that was just a warning that
changing ownership and permissions on /var might cause some problems later...

So the question is, does the error message say that it cannot change 
permissions on
/usr/local/apache/htdocs/file_linux.php
or
 /var/www/html/file_linux.php
?

And does your PHP script have the correct path?

The original problem may just have been that the /usr/local file system was
mounted read-only after the power outage (perhaps due to some disk corruption
caused by the failure?). Since then you have reinstalled apache, but possibly
not in the place your PHP script expects it to be. That would be my first thing
to check...

This sounds really dumb, but it turned out that I have some inconsistencies 
going on in my httpd.conf file. Now I have changed both groups to daemon, and 
changed to owners as Rob suggested. Now it is finally working fine. Would I 
still need to change everything back to 0755? Or, should I ask, what is the 
appropriate permission I should be using here?

Alice


At least that explains why the problem arose from a power failure: you had some 
new settings in the configuration which needed an apache restart to make them 
happen, and when the server rebooted, apache picked up the new settings...


The problem is that if you did "chmod -R 777 /var", you changed every

RE: [PHP] mkdir permission errors

2008-07-15 Thread Wei, Alice J.

From: Peter Ford [EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 7:28 AM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:
>
> -Original Message-
> From: Peter Ford [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2008 4:06 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] mkdir permission errors
>
> Wei, Alice J. wrote:
>> Hi, Rob:
>>
>>   I forgot to mention that I have been using yum install.
>>   I have reinstalled the entire thing, put back all the packages, and then I 
>> went to /var and did a chmod -R 777 var, and then did a
>>
>>[EMAIL PROTECTED] var]# chown -R apache:apache .
>>
>> Interestingly, I do not see anything different, and I still get this error 
>> that says my permission is denied. Here is my
>>
>> [EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
>> root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 
>> /usr/sbin/httpd
>> apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
>> apache|httpd
>>
>> Obviously, my last one has already changed the owner to apache 
>> already.Nevertheless, I am still denied even when I am now logged in as 
>> root. Is this anything with firewalls?
>>
>
> Hang on a minute: you're original message said the error was:
>
> Warning: chmod() [function.chmod]: Permission denied in
> /usr/local/apache/htdocs/file_linux.php on line 27
>
> But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
> apache:apache ." in /var
>
> A few things there:
> When you are changing permissions and ownerships on such a large scale, you
> should always use absolute paths to be sure you are doing the right thing - 
> like
> "chmod -R 777 /var" and "chown -R apache:apache /var"
>
> Next, changing permission and ownership recursively on something like /var is
> likely to wreck your system in weird and wonderful ways, and is pretty 
> difficult
> to undo - you might be looking at a total OS reinstall here (once you've 
> solved
> your Apache problems)
>
> Finally, the error message refers to a file in /usr/local/apache/htdocs, but 
> you
> then are changing permissions in /var - where is your web root?! It looks like
> your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
> files are actually in /var/something...
>
> I forgot to mention that I use Fedora on a Linux machine. I used yum install 
> apache and yum install php to install my packages. Therefore, I don't have a 
> /usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
> originally I do have /usr/local/apache/htdocs that I configured during 
> previous installations. This is not there anymore after my reinstallations 
> since yesterday.
>
> Do I really have to reinstall the entire Fedora? I hate to say that my 
> scripts worked fine BEFORE yesterday until the power went out and nothing 
> went right after I have restarted the entire system.
>
> Alice
>

You don't *have* to reinstall Fedora (yet) - that was just a warning that
changing ownership and permissions on /var might cause some problems later...

So the question is, does the error message say that it cannot change 
permissions on
/usr/local/apache/htdocs/file_linux.php
or
 /var/www/html/file_linux.php
?

And does your PHP script have the correct path?

The original problem may just have been that the /usr/local file system was
mounted read-only after the power outage (perhaps due to some disk corruption
caused by the failure?). Since then you have reinstalled apache, but possibly
not in the place your PHP script expects it to be. That would be my first thing
to check...

This sounds really dumb, but it turned out that I have some inconsistencies 
going on in my httpd.conf file. Now I have changed both 

Re: [PHP] mkdir permission errors

2008-07-15 Thread Peter Ford

Wei, Alice J. wrote:

From: Peter Ford [EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 7:28 AM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:

-Original Message-
From: Peter Ford [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 4:06 AM
To: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:

Hi, Rob:

  I forgot to mention that I have been using yum install.
  I have reinstalled the entire thing, put back all the packages, and then I 
went to /var and did a chmod -R 777 var, and then did a

   [EMAIL PROTECTED] var]# chown -R apache:apache .

Interestingly, I do not see anything different, and I still get this error that 
says my permission is denied. Here is my

[EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
apache|httpd

Obviously, my last one has already changed the owner to apache 
already.Nevertheless, I am still denied even when I am now logged in as root. 
Is this anything with firewalls?


Hang on a minute: you're original message said the error was:

Warning: chmod() [function.chmod]: Permission denied in
/usr/local/apache/htdocs/file_linux.php on line 27

But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
apache:apache ." in /var

A few things there:
When you are changing permissions and ownerships on such a large scale, you
should always use absolute paths to be sure you are doing the right thing - like
"chmod -R 777 /var" and "chown -R apache:apache /var"

Next, changing permission and ownership recursively on something like /var is
likely to wreck your system in weird and wonderful ways, and is pretty difficult
to undo - you might be looking at a total OS reinstall here (once you've solved
your Apache problems)

Finally, the error message refers to a file in /usr/local/apache/htdocs, but you
then are changing permissions in /var - where is your web root?! It looks like
your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
files are actually in /var/something...

I forgot to mention that I use Fedora on a Linux machine. I used yum install 
apache and yum install php to install my packages. Therefore, I don't have a 
/usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
originally I do have /usr/local/apache/htdocs that I configured during previous 
installations. This is not there anymore after my reinstallations since 
yesterday.

Do I really have to reinstall the entire Fedora? I hate to say that my scripts 
worked fine BEFORE yesterday until the power went out and nothing went right 
after I have restarted the entire system.

Alice



You don't *have* to reinstall Fedora (yet) - that was just a warning that
changing ownership and permissions on /var might cause some problems later...

So the question is, does the error message say that it cannot change 
permissions on
/usr/local/apache/htdocs/file_linux.php
or
 /var/www/html/file_linux.php
?

This portion is to answer Rob's question:

[EMAIL PROTECTED] var]# ls -la
total 92
drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
drwxrwxrwx 35 root root 4096 2008-07-14 16:07 lib
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 local
drwxrwxrwx  5 root root 4096 2008-07-15 04:10 lock
drwxrwxrwx 17 root root 4096 2008-07-15 04:10 log
lrwxrwxrwx  1 root root   10 2008-06-24 08:24 mail -> spool/mail
drwxrwxrwx  6 root root 4096 2008-06-24 08:26 named
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 nis
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 opt
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 preserve
drwxrwxrwx 27 root root 4096 2008-07-14 16:12 run
drwxrwxrwx 13 root

RE: [PHP] mkdir permission errors

2008-07-15 Thread Wei, Alice J.

From: Peter Ford [EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 7:28 AM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:
>
> -Original Message-
> From: Peter Ford [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2008 4:06 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] mkdir permission errors
>
> Wei, Alice J. wrote:
>> Hi, Rob:
>>
>>   I forgot to mention that I have been using yum install.
>>   I have reinstalled the entire thing, put back all the packages, and then I 
>> went to /var and did a chmod -R 777 var, and then did a
>>
>>[EMAIL PROTECTED] var]# chown -R apache:apache .
>>
>> Interestingly, I do not see anything different, and I still get this error 
>> that says my permission is denied. Here is my
>>
>> [EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
>> root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 
>> /usr/sbin/httpd
>> apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 
>> /usr/sbin/httpd
>> root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
>> apache|httpd
>>
>> Obviously, my last one has already changed the owner to apache 
>> already.Nevertheless, I am still denied even when I am now logged in as 
>> root. Is this anything with firewalls?
>>
>
> Hang on a minute: you're original message said the error was:
>
> Warning: chmod() [function.chmod]: Permission denied in
> /usr/local/apache/htdocs/file_linux.php on line 27
>
> But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
> apache:apache ." in /var
>
> A few things there:
> When you are changing permissions and ownerships on such a large scale, you
> should always use absolute paths to be sure you are doing the right thing - 
> like
> "chmod -R 777 /var" and "chown -R apache:apache /var"
>
> Next, changing permission and ownership recursively on something like /var is
> likely to wreck your system in weird and wonderful ways, and is pretty 
> difficult
> to undo - you might be looking at a total OS reinstall here (once you've 
> solved
> your Apache problems)
>
> Finally, the error message refers to a file in /usr/local/apache/htdocs, but 
> you
> then are changing permissions in /var - where is your web root?! It looks like
> your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
> files are actually in /var/something...
>
> I forgot to mention that I use Fedora on a Linux machine. I used yum install 
> apache and yum install php to install my packages. Therefore, I don't have a 
> /usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
> originally I do have /usr/local/apache/htdocs that I configured during 
> previous installations. This is not there anymore after my reinstallations 
> since yesterday.
>
> Do I really have to reinstall the entire Fedora? I hate to say that my 
> scripts worked fine BEFORE yesterday until the power went out and nothing 
> went right after I have restarted the entire system.
>
> Alice
>

You don't *have* to reinstall Fedora (yet) - that was just a warning that
changing ownership and permissions on /var might cause some problems later...

So the question is, does the error message say that it cannot change 
permissions on
/usr/local/apache/htdocs/file_linux.php
or
 /var/www/html/file_linux.php
?

This portion is to answer Rob's question:

[EMAIL PROTECTED] var]# ls -la
total 92
drwxrwxrwx 22 root root 4096 2008-06-24 08:34 .
drwxr-xr-x 21 root root 4096 2008-07-14 08:17 ..
drwxrwxrwx  2 root root 4096 2008-06-24 08:25 account
drwxrwxrwx 13 root root 4096 2008-07-14 16:07 cache
drwxrwxrwx  2 root root 4096 2008-02-19 20:47 cvs
drwxrwxrwx  3 root root 4096 2008-06-24 08:25 db
drwxrwxrwx  3 root root 4096 2008-06-24 08:29 empty
drwxrwxrwx  2 root root 4096 2008-04-07 17:44 games
drwxrwxrwx  2 root root 4096 2008-05-01 22:45 gdm
drwx

Re: [PHP] mkdir permission errors

2008-07-15 Thread Peter Ford

Wei, Alice J. wrote:


-Original Message-
From: Peter Ford [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 4:06 AM
To: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:

Hi, Rob:

  I forgot to mention that I have been using yum install.
  I have reinstalled the entire thing, put back all the packages, and then I 
went to /var and did a chmod -R 777 var, and then did a

   [EMAIL PROTECTED] var]# chown -R apache:apache .

Interestingly, I do not see anything different, and I still get this error that 
says my permission is denied. Here is my

[EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
apache|httpd

Obviously, my last one has already changed the owner to apache 
already.Nevertheless, I am still denied even when I am now logged in as root. 
Is this anything with firewalls?



Hang on a minute: you're original message said the error was:

Warning: chmod() [function.chmod]: Permission denied in
/usr/local/apache/htdocs/file_linux.php on line 27

But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
apache:apache ." in /var

A few things there:
When you are changing permissions and ownerships on such a large scale, you
should always use absolute paths to be sure you are doing the right thing - like
"chmod -R 777 /var" and "chown -R apache:apache /var"

Next, changing permission and ownership recursively on something like /var is
likely to wreck your system in weird and wonderful ways, and is pretty difficult
to undo - you might be looking at a total OS reinstall here (once you've solved
your Apache problems)

Finally, the error message refers to a file in /usr/local/apache/htdocs, but you
then are changing permissions in /var - where is your web root?! It looks like
your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
files are actually in /var/something...

I forgot to mention that I use Fedora on a Linux machine. I used yum install 
apache and yum install php to install my packages. Therefore, I don't have a 
/usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
originally I do have /usr/local/apache/htdocs that I configured during previous 
installations. This is not there anymore after my reinstallations since 
yesterday.

Do I really have to reinstall the entire Fedora? I hate to say that my scripts 
worked fine BEFORE yesterday until the power went out and nothing went right 
after I have restarted the entire system.

Alice



You don't *have* to reinstall Fedora (yet) - that was just a warning that 
changing ownership and permissions on /var might cause some problems later...


So the question is, does the error message say that it cannot change 
permissions on
/usr/local/apache/htdocs/file_linux.php
or
 /var/www/html/file_linux.php
?

And does your PHP script have the correct path?

The original problem may just have been that the /usr/local file system was 
mounted read-only after the power outage (perhaps due to some disk corruption 
caused by the failure?). Since then you have reinstalled apache, but possibly 
not in the place your PHP script expects it to be. That would be my first thing 
to check...


--
Peter Ford, Developer phone: 01580 89 fax: 01580 893399
Justcroft International Ltd.  www.justcroft.com
Justcroft House, High Street, Staplehurst, Kent   TN12 0AH   United Kingdom
Registered in England and Wales: 2297906
Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-15 Thread Wei, Alice J.


-Original Message-
From: Peter Ford [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 4:06 AM
To: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

Wei, Alice J. wrote:
> Hi, Rob:
>
>   I forgot to mention that I have been using yum install.
>   I have reinstalled the entire thing, put back all the packages, and then I 
> went to /var and did a chmod -R 777 var, and then did a
>
>[EMAIL PROTECTED] var]# chown -R apache:apache .
>
> Interestingly, I do not see anything different, and I still get this error 
> that says my permission is denied. Here is my
>
> [EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
> root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 
> /usr/sbin/httpd
> apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 
> /usr/sbin/httpd
> apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 
> /usr/sbin/httpd
> root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
> apache|httpd
>
> Obviously, my last one has already changed the owner to apache 
> already.Nevertheless, I am still denied even when I am now logged in as root. 
> Is this anything with firewalls?
>

Hang on a minute: you're original message said the error was:

Warning: chmod() [function.chmod]: Permission denied in
/usr/local/apache/htdocs/file_linux.php on line 27

But you say you've re-installed, and done "chmod -R 777 var" and "chown -R
apache:apache ." in /var

A few things there:
When you are changing permissions and ownerships on such a large scale, you
should always use absolute paths to be sure you are doing the right thing - like
"chmod -R 777 /var" and "chown -R apache:apache /var"

Next, changing permission and ownership recursively on something like /var is
likely to wreck your system in weird and wonderful ways, and is pretty difficult
to undo - you might be looking at a total OS reinstall here (once you've solved
your Apache problems)

Finally, the error message refers to a file in /usr/local/apache/htdocs, but you
then are changing permissions in /var - where is your web root?! It looks like
your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web
files are actually in /var/something...

I forgot to mention that I use Fedora on a Linux machine. I used yum install 
apache and yum install php to install my packages. Therefore, I don't have a 
/usr/local/apache/htdocs folder. The web root is now /var/www/html, which 
originally I do have /usr/local/apache/htdocs that I configured during previous 
installations. This is not there anymore after my reinstallations since 
yesterday.

Do I really have to reinstall the entire Fedora? I hate to say that my scripts 
worked fine BEFORE yesterday until the power went out and nothing went right 
after I have restarted the entire system.

Alice

--
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--
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 permission errors

2008-07-15 Thread Peter Ford

Wei, Alice J. wrote:

Hi, Rob:

  I forgot to mention that I have been using yum install.
  I have reinstalled the entire thing, put back all the packages, and then I 
went to /var and did a chmod -R 777 var, and then did a

   [EMAIL PROTECTED] var]# chown -R apache:apache .

Interestingly, I do not see anything different, and I still get this error that 
says my permission is denied. Here is my

[EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
apache|httpd

Obviously, my last one has already changed the owner to apache 
already.Nevertheless, I am still denied even when I am now logged in as root. 
Is this anything with firewalls?



Hang on a minute: you're original message said the error was:

Warning: chmod() [function.chmod]: Permission denied in 
/usr/local/apache/htdocs/file_linux.php on line 27


But you say you've re-installed, and done "chmod -R 777 var" and "chown -R 
apache:apache ." in /var


A few things there:
When you are changing permissions and ownerships on such a large scale, you 
should always use absolute paths to be sure you are doing the right thing - like 
"chmod -R 777 /var" and "chown -R apache:apache /var"


Next, changing permission and ownership recursively on something like /var is 
likely to wreck your system in weird and wonderful ways, and is pretty difficult 
to undo - you might be looking at a total OS reinstall here (once you've solved 
your Apache problems)


Finally, the error message refers to a file in /usr/local/apache/htdocs, but you 
then are changing permissions in /var - where is your web root?! It looks like 
your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web 
files are actually in /var/something...


--
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 22:09 -0400, Wei, Alice J. wrote:
> > This is the output I have got from using your script.
> > I have made a following quick change:
> >
> > [EMAIL PROTECTED] var]# chown -R root:root .
> >
> > Not surprisingly, I am still not able to make a new directory using PHP 
> > with the HTTP.
> > Could there be anything else I missed?
> 
> I knew who you were when you were on the shell... your ps output showed
> the grep process was running as root. But as the others mentioned...
> you're running the above script as root. As soon as you go to run via
> the webserver things change. In fact, if you run the above as root, and
> create any directories, then those will inherit the root ownerships.
> Then if you run the same script via the web server, those new
> directories may be causing you issues since they trunp the webserver's
> permissions. You might want to go do some reading about *nix ownerships
> and permissions. It's quite important that you have a thorough
> understanding of those if you're going to administer the server.
> 
> Cheers,
> Rob.
> 
> The problem here is that the user is not supposed to be doing this from
> the client end. What happens here is that they execute a client script,
> which then calls the script I have been posting from a different server.
> Therefore, my guess is that I can run this "kind of" like in the command
> line and access it from the root like where my set up is.
> 
> I can see that I am having a problem here getting the script to work
> here. What is interesting is that if my web server is a problem here,
> then how is it possible that I am still able to edit the text files I
> have already created on this particular machine with the "permission
> issues" from a remote server? To get the script to work, do I need to
> edit anymore settings on my server?

How do you connect via the remote server? Presumably, in each case when
you are on the shell, you are the root user. The root user trumps all
ownerships and permissions and can do as it pleases. Also, it may be
that some of your directory creations are succeeding, while others are
failing, depending on the parent directory in which you are attempting
to create a sub-directory. You need to simplify the problem, and focus
on a single problem directory. Find one directory creation that is
failing from the webserver. Then let's deal with it. Determine this
single directory that fails due to permissions violations. Then on the
shell change to the parent directory. Once there type:

ls -al

Note the output and the owner/group names. Please post the output. The
"." directory is the parent directory when you are within the parent
itself.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
> This is the output I have got from using your script.
> I have made a following quick change:
>
> [EMAIL PROTECTED] var]# chown -R root:root .
>
> Not surprisingly, I am still not able to make a new directory using PHP with 
> the HTTP.
> Could there be anything else I missed?

I knew who you were when you were on the shell... your ps output showed
the grep process was running as root. But as the others mentioned...
you're running the above script as root. As soon as you go to run via
the webserver things change. In fact, if you run the above as root, and
create any directories, then those will inherit the root ownerships.
Then if you run the same script via the web server, those new
directories may be causing you issues since they trunp the webserver's
permissions. You might want to go do some reading about *nix ownerships
and permissions. It's quite important that you have a thorough
understanding of those if you're going to administer the server.

Cheers,
Rob.

The problem here is that the user is not supposed to be doing this from the 
client end. What happens here is that they execute a client script, which then 
calls the script I have been posting from a different server. Therefore, my 
guess is that I can run this "kind of" like in the command line and access it 
from the root like where my set up is.

I can see that I am having a problem here getting the script to work here. What 
is interesting is that if my web server is a problem here, then how is it 
possible that I am still able to edit the text files I have already created on 
this particular machine with the "permission issues" from a remote server? To 
get the script to work, do I need to edit anymore settings on my server?

Thanks in advance.

Alice

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 16:45 -0400, Wei, Alice J. wrote:
> Hi, Wolf:
> 
>   Like I guessed, I am still defined as the root user.
> 
> [EMAIL PROTECTED] html]# php test.php
> root
> root/var/www/html
> /var/www/html
> 
> This is the output I have got from using your script.
> I have made a following quick change:
> 
> [EMAIL PROTECTED] var]# chown -R root:root .
> 
> Not surprisingly, I am still not able to make a new directory using PHP with 
> the HTTP.
> Could there be anything else I missed?

I knew who you were when you were on the shell... your ps output showed
the grep process was running as root. But as the others mentioned...
you're running the above script as root. As soon as you go to run via
the webserver things change. In fact, if you run the above as root, and
create any directories, then those will inherit the root ownerships.
Then if you run the same script via the web server, those new
directories may be causing you issues since they trunp the webserver's
permissions. You might want to go do some reading about *nix ownerships
and permissions. It's quite important that you have a thorough
understanding of those if you're going to administer the server.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
Alice: Bottom post like everyone else...

 "Wei wrote: 
> Hi, Wolf:
> 
>   Like I guessed, I am still defined as the root user.
> 
> [EMAIL PROTECTED] html]# php test.php
> root
> root/var/www/html
> /var/www/html
> 
> This is the output I have got from using your script.
> I have made a following quick change:
> 
> [EMAIL PROTECTED] var]# chown -R root:root .
> 
> Not surprisingly, I am still not able to make a new directory using PHP with 
> the HTTP.
> Could there be anything else I missed?
> 
> Alice

You are testing from the CLI but trying to run it via HTTP.  There IS a 
difference and continued testing using a different method is going to give you 
different results...

like the following script acts differently depending on where you use it.



Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:45 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] html]# php test.php
> root
> root/var/www/html
> /var/www/html

Stop testing from the CLI when you need to see results for HTTP then.

-- 

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir permission errors

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:37 PM, Wolf <[EMAIL PROTECTED]> wrote:
>
> $whoami=system('whoami');
> echo $whoami;
>
> $pwd=system('pwd');
> echo $pwd;
>
> That should tell you what ID you are and the path you are in.

Conversely, so will this method:



-- 

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Wolf:

  Like I guessed, I am still defined as the root user.

[EMAIL PROTECTED] html]# php test.php
root
root/var/www/html
/var/www/html

This is the output I have got from using your script.
I have made a following quick change:

[EMAIL PROTECTED] var]# chown -R root:root .

Not surprisingly, I am still not able to make a new directory using PHP with 
the HTTP.
Could there be anything else I missed?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Wolf [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 4:37 PM
To: Wei, Alice J.
Cc: Robert Cummings; php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

 "Wei wrote:
> Hi, Rob:
>
>   I forgot to mention that I have been using yum install.
>   I have reinstalled the entire thing, put back all the packages, and then I 
> went to /var and did a chmod -R 777 var, and then did a
>
>[EMAIL PROTECTED] var]# chown -R apache:apache .
>
> Interestingly, I do not see anything different, and I still get this error 
> that says my permission is denied. Here is my
>
> Obviously, my last one has already changed the owner to apache 
> already.Nevertheless, I am still denied even when I am now logged in as root. 
> Is this anything with firewalls?
>
> Thanks for your help.

Alice,

$whoami=system('whoami');
echo $whoami;

$pwd=system('pwd');
echo $pwd;

That should tell you what ID you are and the path you are in.

Make sure that the path you are in has the correct permissions.

Wolf


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
 "Wei wrote: 
> Hi, Rob:
> 
>   I forgot to mention that I have been using yum install.
>   I have reinstalled the entire thing, put back all the packages, and then I 
> went to /var and did a chmod -R 777 var, and then did a
> 
>[EMAIL PROTECTED] var]# chown -R apache:apache .
> 
> Interestingly, I do not see anything different, and I still get this error 
> that says my permission is denied. Here is my
> 
> Obviously, my last one has already changed the owner to apache 
> already.Nevertheless, I am still denied even when I am now logged in as root. 
> Is this anything with firewalls?
> 
> Thanks for your help.

Alice,

$whoami=system('whoami');
echo $whoami;

$pwd=system('pwd');
echo $pwd;

That should tell you what ID you are and the path you are in.

Make sure that the path you are in has the correct permissions.

Wolf


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob:

  I forgot to mention that I have been using yum install.
  I have reinstalled the entire thing, put back all the packages, and then I 
went to /var and did a chmod -R 777 var, and then did a

   [EMAIL PROTECTED] var]# chown -R apache:apache .

Interestingly, I do not see anything different, and I still get this error that 
says my permission is denied. Here is my

[EMAIL PROTECTED] var]#  ps awxu | grep -E 'apache|httpd'
root 31547  0.0  0.3  21268  6584 ?Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?S16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?S16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?S16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?S16:12   0:00 /usr/sbin/httpd
root 31708  0.0  0.0   4120   728 pts/1R+   16:30   0:00 grep -E 
apache|httpd

Obviously, my last one has already changed the owner to apache 
already.Nevertheless, I am still denied even when I am now logged in as root. 
Is this anything with firewalls?

Thanks for your help.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Robert Cummings [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:59 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

On Mon, 2008-07-14 at 15:49 -0400, Wei, Alice J. wrote:
> Hi, Rob:
>
>   I did follow the instruction of putting in chown apache:apache htdocs. Now 
> when I run the ls -la command, I get this:
>
> [EMAIL PROTECTED] apache]# ls -la
> total 68
> drwxr-xr-x 15 root   root4096 2008-06-24 09:36 .
> drwxr-xr-x 13 root   root4096 2008-07-14 08:53 ..
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 bin
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 build
> drwxr-xr-x  2 root   root4096 2008-07-14 08:57 cgi-bin
> drwxr-xr-x  4 root   root4096 2008-06-25 17:39 conf
> drwxr-xr-x  3 root   root4096 2008-06-24 09:36 error
> drwxr-xr-x  2 apache apache  4096 2008-07-14 15:43 htdocs
> drwxr-xr-x  3 root   root4096 2008-06-24 09:36 icons
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 include
> drwxr-xr-x  4 root   root4096 2008-06-24 09:36 lib
> drwxr-xr-x  2 root   root4096 2008-06-27 14:17 logs
> drwxr-xr-x  4 root   root4096 2008-06-24 09:36 man
> drwxr-xr-x 14 root   root   12288 2008-06-10 15:18 manual
> drwxr-xr-x  2 root   root4096 2008-06-24 09:44 modules
>
> However, this does not change any of the errors I have been getting by 
> executing my PHP code. I still get
>
> Warning: chmod() [function.chmod]: Permission denied in 
> /usr/local/apache/htdocs/file_linux.php on line 27
>
> Is this what I should be having in my ownership of the files?

Well it depends... if that is the exact parent where you are making the
new directory then it should work. But it's not... you are doing it in
the subdirectory "test", or "test/$id" or "test/$id/$somethingelse". It
seems to do it recursively:

chown -R apache:apache htdocs

Note: this will recursively descend into htdocs and change the
permissions on every file directory and file found. You may want to
limit this to directories only:

chown apache:apache htdocs
cd htdocs
chown apache:apache `find -type d`

You may not want this level of ownership change at all. You might just
want to target the appropriate directories. In which case issue chown
for each directory in question.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:49 -0400, Wei, Alice J. wrote:
> Hi, Rob:
> 
>   I did follow the instruction of putting in chown apache:apache htdocs. Now 
> when I run the ls -la command, I get this:
> 
> [EMAIL PROTECTED] apache]# ls -la
> total 68
> drwxr-xr-x 15 root   root4096 2008-06-24 09:36 .
> drwxr-xr-x 13 root   root4096 2008-07-14 08:53 ..
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 bin
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 build
> drwxr-xr-x  2 root   root4096 2008-07-14 08:57 cgi-bin
> drwxr-xr-x  4 root   root4096 2008-06-25 17:39 conf
> drwxr-xr-x  3 root   root4096 2008-06-24 09:36 error
> drwxr-xr-x  2 apache apache  4096 2008-07-14 15:43 htdocs
> drwxr-xr-x  3 root   root4096 2008-06-24 09:36 icons
> drwxr-xr-x  2 root   root4096 2008-06-24 09:36 include
> drwxr-xr-x  4 root   root4096 2008-06-24 09:36 lib
> drwxr-xr-x  2 root   root4096 2008-06-27 14:17 logs
> drwxr-xr-x  4 root   root4096 2008-06-24 09:36 man
> drwxr-xr-x 14 root   root   12288 2008-06-10 15:18 manual
> drwxr-xr-x  2 root   root4096 2008-06-24 09:44 modules
> 
> However, this does not change any of the errors I have been getting by 
> executing my PHP code. I still get
> 
> Warning: chmod() [function.chmod]: Permission denied in 
> /usr/local/apache/htdocs/file_linux.php on line 27
> 
> Is this what I should be having in my ownership of the files?

Well it depends... if that is the exact parent where you are making the
new directory then it should work. But it's not... you are doing it in
the subdirectory "test", or "test/$id" or "test/$id/$somethingelse". It
seems to do it recursively:

chown -R apache:apache htdocs

Note: this will recursively descend into htdocs and change the
permissions on every file directory and file found. You may want to
limit this to directories only:

chown apache:apache htdocs
cd htdocs
chown apache:apache `find -type d`

You may not want this level of ownership change at all. You might just
want to target the appropriate directories. In which case issue chown
for each directory in question.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob:

  I did follow the instruction of putting in chown apache:apache htdocs. Now 
when I run the ls -la command, I get this:

[EMAIL PROTECTED] apache]# ls -la
total 68
drwxr-xr-x 15 root   root4096 2008-06-24 09:36 .
drwxr-xr-x 13 root   root4096 2008-07-14 08:53 ..
drwxr-xr-x  2 root   root4096 2008-06-24 09:36 bin
drwxr-xr-x  2 root   root4096 2008-06-24 09:36 build
drwxr-xr-x  2 root   root4096 2008-07-14 08:57 cgi-bin
drwxr-xr-x  4 root   root4096 2008-06-25 17:39 conf
drwxr-xr-x  3 root   root4096 2008-06-24 09:36 error
drwxr-xr-x  2 apache apache  4096 2008-07-14 15:43 htdocs
drwxr-xr-x  3 root   root4096 2008-06-24 09:36 icons
drwxr-xr-x  2 root   root4096 2008-06-24 09:36 include
drwxr-xr-x  4 root   root4096 2008-06-24 09:36 lib
drwxr-xr-x  2 root   root4096 2008-06-27 14:17 logs
drwxr-xr-x  4 root   root4096 2008-06-24 09:36 man
drwxr-xr-x 14 root   root   12288 2008-06-10 15:18 manual
drwxr-xr-x  2 root   root4096 2008-06-24 09:44 modules

However, this does not change any of the errors I have been getting by 
executing my PHP code. I still get

Warning: chmod() [function.chmod]: Permission denied in 
/usr/local/apache/htdocs/file_linux.php on line 27

Is this what I should be having in my ownership of the files?

Thanks for your help.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Robert Cummings [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:42 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

On Mon, 2008-07-14 at 15:37 -0400, Wei, Alice J. wrote:
> Hi, Rob:
>
>   Here is the updated version from the correct command:
>
> [EMAIL PROTECTED] htdocs]# ps awxu | grep -E 'apache|httpd'
> root 30957  0.0  0.5  27576 11016 ?Ss   14:27   0:00 
> /usr/sbin/httpd
> apache   30959  0.0  0.3  27708  7452 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30960  0.0  0.3  27576  6800 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30961  0.0  0.3  27576  6800 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30962  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30963  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30964  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30965  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30966  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> root 31299  0.0  0.0   4120   676 pts/1R+   15:36   0:00 grep -E 
> apache|httpd
> [EMAIL PROTECTED] htdocs]#
>
> Does this suggest anything?

Yep, apache is not running as root. It is running as user apache. Now go
to the parent directory and input the following command:

chown apache:apache 

That will change the ownership/group to apache. And then apache can
write to it.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:37 -0400, Wei, Alice J. wrote:
> Hi, Rob:
> 
>   Here is the updated version from the correct command:
> 
> [EMAIL PROTECTED] htdocs]# ps awxu | grep -E 'apache|httpd'
> root 30957  0.0  0.5  27576 11016 ?Ss   14:27   0:00 
> /usr/sbin/httpd
> apache   30959  0.0  0.3  27708  7452 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30960  0.0  0.3  27576  6800 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30961  0.0  0.3  27576  6800 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30962  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30963  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30964  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30965  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> apache   30966  0.0  0.3  27576  6788 ?S14:27   0:00 
> /usr/sbin/httpd
> root 31299  0.0  0.0   4120   676 pts/1R+   15:36   0:00 grep -E 
> apache|httpd
> [EMAIL PROTECTED] htdocs]#
> 
> Does this suggest anything?

Yep, apache is not running as root. It is running as user apache. Now go
to the parent directory and input the following command:

chown apache:apache 

That will change the ownership/group to apache. And then apache can
write to it.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob:

  Here is the updated version from the correct command:

[EMAIL PROTECTED] htdocs]# ps awxu | grep -E 'apache|httpd'
root 30957  0.0  0.5  27576 11016 ?Ss   14:27   0:00 /usr/sbin/httpd
apache   30959  0.0  0.3  27708  7452 ?S14:27   0:00 /usr/sbin/httpd
apache   30960  0.0  0.3  27576  6800 ?S14:27   0:00 /usr/sbin/httpd
apache   30961  0.0  0.3  27576  6800 ?S14:27   0:00 /usr/sbin/httpd
apache   30962  0.0  0.3  27576  6788 ?S14:27   0:00 /usr/sbin/httpd
apache   30963  0.0  0.3  27576  6788 ?S14:27   0:00 /usr/sbin/httpd
apache   30964  0.0  0.3  27576  6788 ?S14:27   0:00 /usr/sbin/httpd
apache   30965  0.0  0.3  27576  6788 ?S14:27   0:00 /usr/sbin/httpd
apache   30966  0.0  0.3  27576  6788 ?S14:27   0:00 /usr/sbin/httpd
root 31299  0.0  0.0   4120   676 pts/1R+   15:36   0:00 grep -E 
apache|httpd
[EMAIL PROTECTED] htdocs]#

Does this suggest anything?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Robert Cummings [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:35 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

On Mon, 2008-07-14 at 15:23 -0400, Wei, Alice J. wrote:
> Hi, Rob:
>
>   This is the output:
>
>  root 31232  0.0  0.0   4120   672 pts/1R+   15:22   0:00 grep 
> apache|httpd
>
> Does this help?

Sorry... my bad, can you do the following:

ps awxu | grep -E 'apache|httpd'

I have grep aliased on my system so the -E flag is automatically
added :)

Thanks,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:23 -0400, Wei, Alice J. wrote:
> Hi, Rob:
> 
>   This is the output:
> 
>  root 31232  0.0  0.0   4120   672 pts/1R+   15:22   0:00 grep 
> apache|httpd
> 
> Does this help?

Sorry... my bad, can you do the following:

ps awxu | grep -E 'apache|httpd'

I have grep aliased on my system so the -E flag is automatically
added :)

Thanks,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob:

  This is the output:

 root 31232  0.0  0.0   4120   672 pts/1R+   15:22   0:00 grep 
apache|httpd

Does this help?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Robert Cummings [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:21 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: RE: [PHP] mkdir permission errors

On Mon, 2008-07-14 at 15:11 -0400, Wei, Alice J. wrote:
> Hi,
>
>The apache  is running currently on root as the user.
>The parent directory, test, is set to 0755.
>I have no problems making new directories directly from the terminal 
> prompt, and it does not give me user execution errors like the one in the 
> following.
>I am getting confused with why I can create directories now no longer 
> through the PHP but only through the command prompt manually.
>
> Does this give you information on what my problem might be?

Can you post the following command's output to the list or me personally
if you think it's sensitive:

ps awxu | grep 'apache|httpd'

If apache is running as root as you say then it shouldn't have any
problems doing anything (that's a very dangerous way to run apache btw).
So either apache isn't running as root (maybe you think invoking the
daemon causes it to run as root -- it doesn't), or PHP itself is causing
the access denied problem (safe mode? base dir?).

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:11 -0400, Wei, Alice J. wrote:
> Hi,
> 
>The apache  is running currently on root as the user.
>The parent directory, test, is set to 0755.

These are permissions btw, and not ownerships. Ownerships denote user
and group owners of the directory... specifically the entities to which
the 75 permissions are assigned shown above.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:11 -0400, Wei, Alice J. wrote:
> Hi,
> 
>The apache  is running currently on root as the user.
>The parent directory, test, is set to 0755.
>I have no problems making new directories directly from the terminal 
> prompt, and it does not give me user execution errors like the one in the 
> following.
>I am getting confused with why I can create directories now no longer 
> through the PHP but only through the command prompt manually.
> 
> Does this give you information on what my problem might be?

Can you post the following command's output to the list or me personally
if you think it's sensitive:

ps awxu | grep 'apache|httpd'

If apache is running as root as you say then it shouldn't have any
problems doing anything (that's a very dangerous way to run apache btw).
So either apache isn't running as root (maybe you think invoking the
daemon causes it to run as root -- it doesn't), or PHP itself is causing
the access denied problem (safe mode? base dir?).

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi,

   The apache  is running currently on root as the user.
   The parent directory, test, is set to 0755.
   I have no problems making new directories directly from the terminal prompt, 
and it does not give me user execution errors like the one in the following.
   I am getting confused with why I can create directories now no longer 
through the PHP but only through the command prompt manually.

Does this give you information on what my problem might be?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Robert Cummings [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:07 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir permission errors

On Mon, 2008-07-14 at 15:01 -0400, Wei, Alice J. wrote:
> Hi, Guys:
>
>I have a very strange incident here that may seem very stupid. Since the 
> power went out last night, I have restarted my server. However, now the 
> permission is never working right. I have set the permission of my htdocs 
> folder iof my Apache server to 0755, and then started executing the following.
>
>   $id=$_REQUEST['id'];
>   $filename = "/usr/local/apache/htdocs/test";
>
> if (file_exists($filename)) {
>
>  mkdir("/usr/local/apache/htdocs/test/$id", 0777) or die ("Cannot 
> create directory");
> chmod("/usr/local/apache/htdocs/test/$id", 0777);
>  mkdir("/usr/local/apache/htdocs/test/$id/contours", 0755) or die 
> ("Cannot create directory");
>  chmod ("/usr/local/apache/htdocs/test/$id/contours",0777);
>  mkdir ("/usr/local/apache/htdocs//$id/beamdata", 0777) or die 
> ("Cannot create directory");
>   mkdir("/usr/local/apache/htdocs//$id/schemadata", 0777) or die 
> ("Cannot create directory");
>   mkdir("/usr/local/apache/htdocs/$id/plandata", 0777) or die ("Cannot 
> create directory");
>
> }
>
> else {
>
>   mkdir("/usr/local/apache/htdocs/test", 0777) or die ("Cannot create 
> directory http://192.168.10.63/TPU");
> }
>
> However, the error always bumped me with Cannot create directory 
> http://192.168.10.63/test.
> I went into my error logs, and it continuously give me this:
>
> [Mon Jul 14 14:51:07 2008] [error] [client 192.168.10.63] PHP Warning:  
> mkdir() [function.mkdir]: Permission denied in 
> /usr/local/apache/htdocs/file_linux.php on line 23
>
> Can anyone please give me a hint on what could be wrong here? I have set my 
> parent directory to 0755 already.

Under what user does apache run?

What are the ownerships on the parent directory?

Can you create the directory if you log in as the apache user (su
apacheuser)?

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:01 -0400, Wei, Alice J. wrote:
> Hi, Guys:
> 
>I have a very strange incident here that may seem very stupid. Since the 
> power went out last night, I have restarted my server. However, now the 
> permission is never working right. I have set the permission of my htdocs 
> folder iof my Apache server to 0755, and then started executing the following.
> 
>   $id=$_REQUEST['id'];
>   $filename = "/usr/local/apache/htdocs/test";
> 
> if (file_exists($filename)) {
> 
>  mkdir("/usr/local/apache/htdocs/test/$id", 0777) or die ("Cannot 
> create directory");
> chmod("/usr/local/apache/htdocs/test/$id", 0777);
>  mkdir("/usr/local/apache/htdocs/test/$id/contours", 0755) or die 
> ("Cannot create directory");
>  chmod ("/usr/local/apache/htdocs/test/$id/contours",0777);
>  mkdir ("/usr/local/apache/htdocs//$id/beamdata", 0777) or die 
> ("Cannot create directory");
>   mkdir("/usr/local/apache/htdocs//$id/schemadata", 0777) or die 
> ("Cannot create directory");
>   mkdir("/usr/local/apache/htdocs/$id/plandata", 0777) or die ("Cannot 
> create directory");
> 
> }
> 
> else {
> 
>   mkdir("/usr/local/apache/htdocs/test", 0777) or die ("Cannot create 
> directory http://192.168.10.63/TPU");
> }
> 
> However, the error always bumped me with Cannot create directory 
> http://192.168.10.63/test.
> I went into my error logs, and it continuously give me this:
> 
> [Mon Jul 14 14:51:07 2008] [error] [client 192.168.10.63] PHP Warning:  
> mkdir() [function.mkdir]: Permission denied in 
> /usr/local/apache/htdocs/file_linux.php on line 23
> 
> Can anyone please give me a hint on what could be wrong here? I have set my 
> parent directory to 0755 already.

Under what user does apache run?

What are the ownerships on the parent directory?

Can you create the directory if you log in as the apache user (su
apacheuser)?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir() Cannot Create Directories

2008-06-17 Thread Nitsan Bin-Nun
As far as I remember, when I was on shared windows I had something similar
(no access to upload/create folders), the tech guy at the company i was
hosting at changed something in my privileges and it solved it.
You may have no creating privileges.


On 17/06/2008, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a code here that I am intending to create new directories by
> creating a parent and then proceed on to create the children one by one.
>
> I am trying to create directories in the server I am running my script from
> as shown in the snippet below. My problem is that although the code seems to
> be accurate, it keeps telling me that I cannot create the directories with
> the following error message:
>
>
>
> Cannot create directory C:/Inetpub/wwwroot/TPU/test/2
>
>
>
> This is my PHP code:
>
>
>
> mkdir("C:/Inetpub/wwwroot/TPU/test/$id, 0755) or die ("Cannot create
> directory C:/Inetpub/wwwroot/TPU/test/$id");
>
>
>
> What is strange is that I don't get permission denied errors, but I still
> cannot create the directories. Can anyone provide me some tips on why I am
> getting these errors?
>
>
>
> Thanks in advance.
>
>
>
> Alice
>
> ==
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


RE: [PHP] mkdir() Cannot Create Directories

2008-06-17 Thread Wei, Alice J.
Hi, Daniel:

  Thanks, I didn't realize that is the only problem. It sure is working  pretty 
good now.

   One question, why didn't I get "Permission Denied" when I tried to do it 
before the execution permissions were set properly?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Daniel Brown [EMAIL PROTECTED]
Sent: Tuesday, June 17, 2008 2:54 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mkdir() Cannot Create Directories

On Tue, Jun 17, 2008 at 2:43 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
> Hi,
>
[snip!]
>
> This is my PHP code:
>
> mkdir("C:/Inetpub/wwwroot/TPU/test/$id, 0755) or die ("Cannot create 
> directory C:/Inetpub/wwwroot/TPU/test/$id");
>
>  What is strange is that I don't get permission denied errors, but I still 
> cannot create the directories. Can anyone provide me some tips on why I am 
> getting these errors?

Does 'C:\Inetpub\wwwroot\TPU\test\' exist on the server, and is it
writable?  Maybe you're just missing a directory up to that point
(such as 'test'), or maybe it's not on your C:\ drive.

--

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir() Cannot Create Directories

2008-06-17 Thread David Giragosian
On 6/17/08, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
> On Tue, Jun 17, 2008 at 2:43 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> [snip!]
> >
> > This is my PHP code:
> >
> > mkdir("C:/Inetpub/wwwroot/TPU/test/$id, 0755) or die ("Cannot create
> directory C:/Inetpub/wwwroot/TPU/test/$id");
> >
> >  What is strange is that I don't get permission denied errors, but I
> still cannot create the directories. Can anyone provide me some tips on why
> I am getting these errors?
>
>Does 'C:\Inetpub\wwwroot\TPU\test\' exist on the server, and is it
> writable?  Maybe you're just missing a directory up to that point
> (such as 'test'), or maybe it's not on your C:\ drive.


Alice, that's a default IIS path to the web root, so I assume you _might_ be
using IIS. Maybe the IIS manager is locking you out somehow.

--David.


Re: [PHP] mkdir() Cannot Create Directories

2008-06-17 Thread Daniel Brown
On Tue, Jun 17, 2008 at 2:43 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
> Hi,
>
[snip!]
>
> This is my PHP code:
>
> mkdir("C:/Inetpub/wwwroot/TPU/test/$id, 0755) or die ("Cannot create 
> directory C:/Inetpub/wwwroot/TPU/test/$id");
>
>  What is strange is that I don't get permission denied errors, but I still 
> cannot create the directories. Can anyone provide me some tips on why I am 
> getting these errors?

Does 'C:\Inetpub\wwwroot\TPU\test\' exist on the server, and is it
writable?  Maybe you're just missing a directory up to that point
(such as 'test'), or maybe it's not on your C:\ drive.

-- 

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir, Shared Hosting?

2005-08-08 Thread Esteamedpw
 
Thanks, I thought that might have been it - but It's not... I wrote a  
support ticket and - now - I'm able to use mkdir as long as the  Directories 
are 
chmoded to 755+   :)
 
thanks to all who helped!
 
 
In a message dated 8/8/2005 2:16:12 A.M. Central Standard Time,  
[EMAIL PROTECTED] writes:

>More  than likely, your host has safe mode on. Safe mode is a pain in the  
>ass if you need to create directories or write to files, but seems to  be 
>the defacto standard for shared hosts using  php.


 


Re: [PHP] mkdir, Shared Hosting?

2005-08-08 Thread hitek
More than likely, your host has safe mode on. Safe mode is a pain in the 
ass if you need to create directories or write to files, but seems to be 
the defacto standard for shared hosts using php.


[EMAIL PROTECTED] wrote:



Thanks, but I've tried that when I first got the Error message, it still  
gave me the error. Thanks though!


In a message dated 8/7/2005 1:29:26 A.M. Central Standard Time,  
[EMAIL PROTECTED] writes:


 

Open  up your FTP client and log into your website, then change the  
permissions on your folder so that the apache process has write access  
to it.  Its really hit and miss depending on your  setup.
   



 

The sure fire way (but highly insecure) way is to change the  permissions 
to the directory in question to 777.
   



 


A better  solution would be 755, but it may not work.
   



 


Try it, and see what  you get.
   







 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir, Shared Hosting?

2005-08-07 Thread Esteamedpw
 
Thanks, but I've tried that when I first got the Error message, it still  
gave me the error. Thanks though!
 
In a message dated 8/7/2005 1:29:26 A.M. Central Standard Time,  
[EMAIL PROTECTED] writes:

>Open  up your FTP client and log into your website, then change the  
>permissions on your folder so that the apache process has write access  
>to it.  Its really hit and miss depending on your  setup.

>The sure fire way (but highly insecure) way is to change the  permissions 
>to the directory in question to 777.

>A better  solution would be 755, but it may not work.

>Try it, and see what  you get.



 


Re: [PHP] mkdir, Shared Hosting?

2005-08-06 Thread Burhan Khalid

[EMAIL PROTECTED] wrote:
 
In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,  
[EMAIL PROTECTED] writes:


As far  as I know, it's not a shared hosting issue, but a permission issue.
The  site admin has not given the user under which your php scripts  run
permission to create directories and most likely files and other file  system
operations.  It's a security  issue.

Robbert


 
I see... I guess I could ask to see if I could get permission to do so  then? 
lol never hurts to ask :)


Open up your FTP client and log into your website, then change the 
permissions on your folder so that the apache process has write access 
to it.  Its really hit and miss depending on your setup.


The sure fire way (but highly insecure) way is to change the permissions 
to the directory in question to 777.


A better solution would be 755, but it may not work.

Try it, and see what you get.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir, Shared Hosting?

2005-08-06 Thread Esteamedpw
 
In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,  
[EMAIL PROTECTED] writes:

As far  as I know, it's not a shared hosting issue, but a permission issue.
The  site admin has not given the user under which your php scripts  run
permission to create directories and most likely files and other file  system
operations.  It's a security  issue.

Robbert


 
I see... I guess I could ask to see if I could get permission to do so  then? 
lol never hurts to ask :)
 
Thanks,
 
Clint



RE: [PHP] mkdir, Shared Hosting?

2005-08-06 Thread Robbert van Andel
As far as I know, it's not a shared hosting issue, but a permission issue.
The site admin has not given the user under which your php scripts run
permission to create directories and most likely files and other file system
operations.  It's a security issue.

Robbert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 06, 2005 8:53 PM
To: php-general@lists.php.net
Subject: [PHP] mkdir, Shared Hosting?

Hi,

I'm using Shared Hosting and I was told - then I learned from  trial and  
error - that you can't use mkdir on Shared Hosting... is  this *100%* true? 
is  
there a way around it?

I  get:

Warning:  mkdir(/home/***/public_html/test/): Permission denied  in  
/home/***/public_html/test.php on line 3 

So, again, is  there any possible way around this? I've Googled,  read the 
manual but  it seems that If I don't get an Error - I get nothing at  all,  
including the directory.

Thanks for any help!

-  Clint

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir security concern

2005-01-20 Thread kids_pro
So your suggestion is that I should create an ftp account and use this 
account to create folder structure for user right?

I still not sure about the permission to set.
If I set 0755 how do OS know who is the owner?

May be I think too much. But let say I use ftp account: ftp1 to create 
folder structure
That mean owner is ftp1 user right? And then later I use PHP file upload 
script to upload image to user folders what will happen?




"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> kids_pro wrote:
>> Hi there,
>>
>> I want to create a script.
>> When user register I want to create a folder : 
>> users\\images
>> The purpose is that I want to allow them to upload image to this image 
>> folders.
>>
>> What sort of permission should I give to each folder
>> Root: users, , and images folder.
>>
>
> The least necessary. That depends on your server setup, primarily the user 
> id your scripts are run under (mod_php/cgi or suexec). You might want to 
> use ftp functions to create the directories if they would be created with 
> apache as the owner otherwise. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir security concern

2005-01-20 Thread Marek Kilimajer
kids_pro wrote:
Hi there,
I want to create a script.
When user register I want to create a folder : 
users\\images
The purpose is that I want to allow them to upload image to this image 
folders.

What sort of permission should I give to each folder
Root: users, , and images folder.
The least necessary. That depends on your server setup, primarily the 
user id your scripts are run under (mod_php/cgi or suexec). You might 
want to use ftp functions to create the directories if they would be 
created with apache as the owner otherwise.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mkdir() permissions

2004-08-19 Thread Richard Whitney
Dear List!

Anyone out there using cPanel?
Perhaps you could instruct me as to how to rebuild PHP, assuming we
have similar file structure,
such that cPanel seems to do.

Many kind regards!

Richard

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir() permissions

2004-08-18 Thread Matthew Sims
> Hi
>
> I am new to PHP and I'm trying that my script checks if a directory exists
> and
> if not, it should create it. I'm doing it with mkdir() but it returns this
> error message:
>
> Warning: mkdir(0): Permission denied in /xx on line 32
>
> I wonder what kind of permissions should I set. This should be doable by
> any
> visitor.
>
> Thanks for your help.
>
> Percy

It you're trying to do this through a web server, then permissions need to
be set with the web server. Directories and files need to be owned by the
whatever UID the web server runs as (nobody, www, etc).

If you're running it through a stand alone script, well then, if you don't
own the directory or you're not root, that's probably the problem.



-- 
--Matthew Sims
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mkdir after mkdir

2004-06-06 Thread Uttam
guess it has something to do with default directory rights for newly created
directories??

the directory 'x' gives your script permission to create directory under it.
so you are able to create directory 'y' inside 'x'.  but the newly created
directory 'y' does not gives your script permission to create subdirectory.

Regards,
-Original Message-
From: Gerben [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 06, 2004 23:39
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mkdir after mkdir


Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).

This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.

Thanks anyway

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Gerben wrote:
> > Hello,
> >
> > I have a problem with the mkdir function.
> > I'm trying to make a seperate folder every photoalbum. inside I want to
> > create another folder ('.../thumbnails/') for, you can guess, the
> > thumbnails.
> >
> > At first it didn't work at all:
> >
> >
> >>Warning: mkdir() failed (Permission denied) in
> >
> > /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >
> > When I changed the rights of the folder I wanted to create the new
folder in
> > to chmod 0777, the first MKDIR did work, but the second did not.
> >
> >
> >>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >
> > allowed to access
> > /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> > by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> > on line 43
> >
> > this is very strange because the folders are both made in the same
script.
> > Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> > the created folder it is 0755 and I can not change it.
> >
> > That's pritty much my problem. Your help would be very much appreciated.
> >
>
> The first directory your script creates is owned by the uid apache runs
> under (48 in your case). Safe mode allows access only to files and
> directories owned by the uid of the executing script (1042 in your case).
>
> The workaround is to use ftp functions to create the directories. Simply
>   use your ftp username and password to login to localhost and create
> the directories.
>
> HTH

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir after mkdir

2004-06-06 Thread Marek Kilimajer
Gerben wrote:
Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).
This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.
Ask your hosting company to install ftp server (and ftp support in php) 
that is at least accessible from localhost. Otherwise you will have to 
give up the idea of creating folders whatsoever as you will not be able 
to copy images to those folders. Or change your host.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mkdir after mkdir

2004-06-06 Thread Kevin Murphy
I'm still kind of a newbie at this, but couldn't you accomplish this by 
doing each MKDIR separately with a series of ELSE/IF statements. The 
basic logic would be:

Check if parent DIR exists.
If not, create one and then go on
If yes:
Check if Child DIR Exists
If Not, Create one,
if yes, go on
Etc.
--
Kevin Murphy
Web Designer - Stubborn Donkey Productions
www.stubborndonkey.com
On Jun 6, 2004, at 11:08 AM, Gerben wrote:
Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).
This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.
Thanks anyway
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Gerben wrote:
Hello,
I have a problem with the mkdir function.
I'm trying to make a seperate folder every photoalbum. inside I want 
to
create another folder ('.../thumbnails/') for, you can guess, the
thumbnails.

At first it didn't work at all:

Warning: mkdir() failed (Permission denied) in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on 
line 42

When I changed the rights of the folder I wanted to create the new
folder in
to chmod 0777, the first MKDIR did work, but the second did not.

SAFE MODE Restriction in effect. The script whose uid is 1042 is not
allowed to access
/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
on line 43
this is very strange because the folders are both made in the same
script.
Another strange thing is that I user mkdir($dir, 0777), but when I 
look
at
the created folder it is 0755 and I can not change it.
That's pritty much my problem. Your help would be very much 
appreciated.

The first directory your script creates is owned by the uid apache 
runs
under (48 in your case). Safe mode allows access only to files and
directories owned by the uid of the executing script (1042 in your 
case).

The workaround is to use ftp functions to create the directories. 
Simply
  use your ftp username and password to login to localhost and create
the directories.

HTH
--
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 after mkdir

2004-06-06 Thread Gerben
Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).

This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.

Thanks anyway

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Gerben wrote:
> > Hello,
> >
> > I have a problem with the mkdir function.
> > I'm trying to make a seperate folder every photoalbum. inside I want to
> > create another folder ('.../thumbnails/') for, you can guess, the
> > thumbnails.
> >
> > At first it didn't work at all:
> >
> >
> >>Warning: mkdir() failed (Permission denied) in
> >
> > /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >
> > When I changed the rights of the folder I wanted to create the new
folder in
> > to chmod 0777, the first MKDIR did work, but the second did not.
> >
> >
> >>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >
> > allowed to access
> > /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> > by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> > on line 43
> >
> > this is very strange because the folders are both made in the same
script.
> > Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> > the created folder it is 0755 and I can not change it.
> >
> > That's pritty much my problem. Your help would be very much appreciated.
> >
>
> The first directory your script creates is owned by the uid apache runs
> under (48 in your case). Safe mode allows access only to files and
> directories owned by the uid of the executing script (1042 in your case).
>
> The workaround is to use ftp functions to create the directories. Simply
>   use your ftp username and password to login to localhost and create
> the directories.
>
> HTH

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir after mkdir

2004-06-06 Thread Gerben
I have those rights since the first dir is created. the problem is that the
2nd is not created

"Daniel Clark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I think PHP and mkdir() is using the web servers rights.   So the web
server would need rights to create directories.
>
> >>Hello,
> >>
> >>I have a problem with the mkdir function.
> >>I'm trying to make a seperate folder every photoalbum. inside I want to
> >>create another folder ('.../thumbnails/') for, you can guess, the
> >>thumbnails.
> >>
> >>At first it didn't work at all:
> >>
> >>>Warning: mkdir() failed (Permission denied) in
> >>/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >>
> >>When I changed the rights of the folder I wanted to create the new
folder in
> >>to chmod 0777, the first MKDIR did work, but the second did not.
> >>
> >>>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >>allowed to access
> >>/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> >>by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> >>on line 43
> >>
> >>this is very strange because the folders are both made in the same
script.
> >>Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> >>the created folder it is 0755 and I can not change it.
> >>
> >>That's pritty much my problem. Your help would be very much appreciated.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir after mkdir

2004-06-06 Thread Marek Kilimajer
Gerben wrote:
Hello,
I have a problem with the mkdir function.
I'm trying to make a seperate folder every photoalbum. inside I want to
create another folder ('.../thumbnails/') for, you can guess, the
thumbnails.
At first it didn't work at all:

Warning: mkdir() failed (Permission denied) in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
When I changed the rights of the folder I wanted to create the new folder in
to chmod 0777, the first MKDIR did work, but the second did not.

SAFE MODE Restriction in effect. The script whose uid is 1042 is not
allowed to access
/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0 owned
by uid 48 in /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
on line 43
this is very strange because the folders are both made in the same script.
Another strange thing is that I user mkdir($dir, 0777), but when I look at
the created folder it is 0755 and I can not change it.
That's pritty much my problem. Your help would be very much appreciated.
The first directory your script creates is owned by the uid apache runs 
under (48 in your case). Safe mode allows access only to files and 
directories owned by the uid of the executing script (1042 in your case).

The workaround is to use ftp functions to create the directories. Simply 
 use your ftp username and password to login to localhost and create 
the directories.

HTH
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mkdir after mkdir

2004-06-06 Thread Daniel Clark
I think PHP and mkdir() is using the web servers rights.   So the web server would 
need rights to create directories.

>>Hello,
>>
>>I have a problem with the mkdir function.
>>I'm trying to make a seperate folder every photoalbum. inside I want to
>>create another folder ('.../thumbnails/') for, you can guess, the
>>thumbnails.
>>
>>At first it didn't work at all:
>>
>>>Warning: mkdir() failed (Permission denied) in
>>/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
>>
>>When I changed the rights of the folder I wanted to create the new folder in
>>to chmod 0777, the first MKDIR did work, but the second did not.
>>
>>>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
>>allowed to access
>>/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0 owned
>>by uid 48 in /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
>>on line 43
>>
>>this is very strange because the folders are both made in the same script.
>>Another strange thing is that I user mkdir($dir, 0777), but when I look at
>>the created folder it is 0755 and I can not change it.
>>
>>That's pritty much my problem. Your help would be very much appreciated.

-- 
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???

2004-02-29 Thread raisinlove
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


Re: [PHP] mkdir and rmdir possible but not readdir and opendir???

2004-02-28 Thread Rasmus Lerdorf
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



Re: [PHP] mkdir and rmdir possible but not readdir and opendir???

2004-02-28 Thread raisinlove
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???

2004-02-28 Thread raisinlove
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???

2004-02-28 Thread Rasmus Lerdorf
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???

2004-02-28 Thread Jason Wong
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 with PHP 4.3.4 and IIS 5.0 on Windows 2000

2003-11-18 Thread Jay Blanchard
[snip]
In my case, I've created a function called mkdirs that recursively
checks and does a mkdir on a given path.  So, if any of the folders in a
given path don't exist, then they will get created.  I include this at
the top via "include('func/mkdirs.php');".  I've used this mkdirs
function in other scripts, and I know it's working fine. 
[/snip]
 
Then try doing it outside of the function (directly) to see if you spot
any problems


RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000

2003-11-18 Thread Dang Nguyen
In my case, I've created a function called mkdirs that recursively checks
and does a mkdir on a given path.  So, if any of the folders in a given path
don't exist, then they will get created.  I include this at the top via
"include('func/mkdirs.php');".  I've used this mkdirs function in other
scripts, and I know it's working fine.

mkdirs.php contains:
 1) {
  $pStrPath = dirname($strPath);
  if (!mkdirs($pStrPath, $mode)) return false;
  }

  return mkdir($strPath,$mode);
}
?>

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 11:38 AM
To: Dang Nguyen; [EMAIL PROTECTED]
Subject: RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000


[snip]
mkdirs($directory,0755);
[/snip]

should be 
mkdir($directory,0755);

make sure the script has permission to make a directory, most scripts
run as 'nobody' and 'nobody' does not have permission to create a
directory

http://us3.php.net/mkdir


RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000

2003-11-18 Thread Jay Blanchard
[snip]
mkdirs($directory,0755);
[/snip]

should be 
mkdir($directory,0755);

make sure the script has permission to make a directory, most scripts
run as 'nobody' and 'nobody' does not have permission to create a
directory

http://us3.php.net/mkdir

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mkdir(blah,0777)

2003-01-07 Thread rw
Thank you, Jason!

Quoting Jason Wong <[EMAIL PROTECTED]>:

### On Wednesday 08 January 2003 12:05, [EMAIL PROTECTED] wrote:
### > I have an interesting situation!
### >
### > I get a dir to be made - no problem, but I want it to have the
### permissions
### > 0777. When I look in the directory that was just created (blah 
### drwxr-x---)
### > are the permissions.
### 
### Look at umask().
### 
### -- 
### Jason Wong -> Gremlins Associates -> www.gremlins.biz
### Open Source Software Systems Integrators
### * Web Design & Hosting * Internet & Intranet Applications Development *
### 
### /*
### An age is called Dark not because the light fails to shine, but because
### people refuse to see it.
### -- James Michener, "Space"
### */
### 
### 
### -- 
### 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(blah,0777)

2003-01-07 Thread Jason Wong
On Wednesday 08 January 2003 12:05, [EMAIL PROTECTED] wrote:
> I have an interesting situation!
>
> I get a dir to be made - no problem, but I want it to have the permissions
> 0777. When I look in the directory that was just created (blah  drwxr-x---)
> are the permissions.

Look at umask().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
An age is called Dark not because the light fails to shine, but because
people refuse to see it.
-- James Michener, "Space"
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir() makes dir, but with wrong owner

2002-12-20 Thread Marek Kilimajer
Another option is to use ftp functions.

John W. Holmes wrote:


  i had a few problems with mkdir() ane uploading files using php.

  i have a simple script, which is making a dir. but everytime, it
  makes a dir with totally wrong user. chown wont work.

  any expirience with this?? i have found some older posts
  considering this, but no real answers. i think, the problem is
  probably in httpd.conf (apche config file), but i am not sure.
   


That's normal. PHP runs as the Apache user, so anything it creates will
be owned by that user. Workaround is to use CGI mode or make the dir 777
so you can still access it. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mkdir() makes dir, but with wrong owner

2002-12-20 Thread John W. Holmes
>i had a few problems with mkdir() ane uploading files using php.
> 
>i have a simple script, which is making a dir. but everytime, it
>makes a dir with totally wrong user. chown wont work.
> 
>any expirience with this?? i have found some older posts
>considering this, but no real answers. i think, the problem is
>probably in httpd.conf (apche config file), but i am not sure.

That's normal. PHP runs as the Apache user, so anything it creates will
be owned by that user. Workaround is to use CGI mode or make the dir 777
so you can still access it. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir()

2002-11-08 Thread Marco Tabini
The problem is that your webserver is not running as "you"...it's
running under a common user (probably nobody or apache) and that user
does not--and cannot--have access to your folder for security reasons.

You can try creating the directory through ftp via PHP.


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

On Fri, 2002-11-08 at 21:11, Edward Peloke wrote:
> I have been using the mkdir function sucessfully on my windows test machine, but 
>when I uploaded my pages to my hosting server (which is linux) I get a permission 
>error when the mkdir function is called.  I know I can create directories because I 
>can do it fine when I am using ws-ftp uploading pages...any ideas?  Here is the mkdir 
>call..
> 
> mkdir("$uname",0777);
> 
> Thanks,
> Eddie



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread @ Edwin
Hello,

Just a few comments... And no, I'm not Jason :)

"Monty" <[EMAIL PROTECTED]> wrote:
> Hi Jason, I have a follow-up question about mkdir. If the files created by
> mkdir are owned by 'nobody', does that create a security risk for those
> files?

No, not really.

> If so, how does one get around accepting files via an upload form
> that are assigned to a user other than 'nobody'?

Perhaps, you can check this: (Also see: "User Contributed Notes")

  http://www.php.net/manual/en/function.chown.php

- E

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Monty
Hi Jason, I have a follow-up question about mkdir. If the files created by
mkdir are owned by 'nobody', does that create a security risk for those
files? If so, how does one get around accepting files via an upload form
that are assigned to a user other than 'nobody'?

Monty



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Marek Kilimajer
Actualy, you can use chgrp(), but apache must be a member of the group 
you are changing to.

Jason Wong wrote:

On Friday 25 October 2002 06:51, Matias Silva wrote:
 

Hi-ya all, here's a quickie...

In my script I create a directory (mysql.backup.timestamp/) within a
directory called backup/.
I use  the function  mkdir("mysql.backup.timestamp", "0777");  and it shows
the permissions
as after the function executes:

   drx--t   2 nobodydaemon1024 Oct 24 15:16
mysql.backup.October-24-2002-1516

Where's the permissions (drx--t   2 nobody   daemon) coming from?  Is
it the php.ini, apache conf or
the operating system?
   


The permissions (rx--t) is coming from your mode setting in your mkdir() 
function AND from the system setting umask -- see manual -> umask() and check 
out user comments as well.

 

I would like to set the owner to "root" and the group to "nc".  How can
this be achieved
by the php script?  Or do I have set this up in the other environments (OS
or Apache)?
   


You can't.

The user:group comes from the user running the webserver, which in your case 
is nobody:daemon.

Only root can the the user:group ownership of files and directories. So unless 
your webserver is running as root you cannot use chown()/chgrp().


 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Jason Wong
On Friday 25 October 2002 06:51, Matias Silva wrote:
> Hi-ya all, here's a quickie...
>
> In my script I create a directory (mysql.backup.timestamp/) within a
> directory called backup/.
> I use  the function  mkdir("mysql.backup.timestamp", "0777");  and it shows
> the permissions
> as after the function executes:
>
> drx--t   2 nobodydaemon1024 Oct 24 15:16
> mysql.backup.October-24-2002-1516
>
> Where's the permissions (drx--t   2 nobody   daemon) coming from?  Is
> it the php.ini, apache conf or
> the operating system?

The permissions (rx--t) is coming from your mode setting in your mkdir() 
function AND from the system setting umask -- see manual -> umask() and check 
out user comments as well.

> I would like to set the owner to "root" and the group to "nc".  How can
> this be achieved
> by the php script?  Or do I have set this up in the other environments (OS
> or Apache)?

You can't.

The user:group comes from the user running the webserver, which in your case 
is nobody:daemon.

Only root can the the user:group ownership of files and directories. So unless 
your webserver is running as root you cannot use chown()/chgrp().


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
After years of research, scientists recently reported that there is,
indeed, arroz in Spanish Harlem.
*/

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Richard B. Johnson wrote:
> It's a "tomorrow" thing. Ten hours it too long to stare at a
> screen.

Sissy!

- Jens Axboe on linux-kernel
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell

Got it but the solution is derned freaky... talking to the webserver admin I
come to find out that I have to write a stub executable to php4.cgi which
will interpret the PHP script bypassing the Apache mods.. that way I can
keep the directories at the default 0755 and STILL be able to do file mkdir
and uploading!!

Phil

- Original Message - 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Phil Powell'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, September 28, 2002 7:04 PM
Subject: RE: [PHP] mkdir() failed: Permission denied


> _YOU_ don't need write permissions, the web server does
> 
> ---John Holmes...
> 
> > -Original Message-
> > From: Phil Powell [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 4:24 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: [PHP] mkdir() failed: Permission denied
> > 
> > Ok I did just that.. Permission is set for /users/ppowell/web/my at
> 0755
> > giving me full write permissions onto that directory, I would think,
> to
> > create subdirectory /images.
> > 
> > However, I can't do that because I get the following error:
> > 
> > on line 27:
> > if (!is_dir($path)) mkdir($path, 01755);
> > 
> > // $path = "/users/ppowell/web/my/images/";
> > 
> > Warning: Unable to access /users/ppowell/web/my/images/ in
> > /users/ppowell/web/my/process.php on line 27
> > 
> > 
> > 
> > 
> > Phil
> > - Original Message -
> > From: "John W. Holmes" <[EMAIL PROTECTED]>
> > To: "'Phil Powell'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Saturday, September 28, 2002 4:22 PM
> > Subject: RE: [PHP] mkdir() failed: Permission denied
> > 
> > 
> > > Whatever user your web server is running as needs to have permission
> to
> > > write to that directory that you are trying to make the new one in.
> > >
> > > ---John Holmes...
> > >
> > > > -Original Message-
> > > > From: Phil Powell [mailto:[EMAIL PROTECTED]]
> > > > Sent: Saturday, September 28, 2002 3:38 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] mkdir() failed: Permission denied
> > > >
> > > > Ok, I am stuck.  I am trying to create a folder in the same
> directory
> > > as
> > > > process.php and then use
> > > move_uploaded_file($FILES['myImage]['tmp_name'])
> > > > and it constantly fails:
> > > >
> > > > mkdir() failed (Permission denied)
> > > >
> > > > Here is my code:
> > > >
> > > >  > > >   $willChangeLayout = 1; $isEmptyLayoutValues = 1;
> > > >
> > > >   foreach ($_POST as $key => $val) {
> > > >if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout =
> 0;
> > > >if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
> > > >${"$key"} = $val;
> > > >   }
> > > >
> > > >   // SERVER-SIDE VALIDATION
> > > >   if ($willChangeLayout && $isEmptyLayoutValues)
> > > >header("Location: " . $refURL . "?errorMsg=" .
> urlencode("Please
> > > fill
> > > > out
> > > > all required fields"));
> > > >
> > > >   // FILE UPLOAD HANDLING
> > > >
> > > >   $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> > > >
> > > >   if (is_uploaded_file($_FILES['myImage']['tmp_name']))
> > > >move_uploaded_file($_FILES['myImage']['tmp_name'],
> > > > "/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
> > > >
> > > >
> > > > ?>
> > > >
> > > > Please someone tell me what I'm doing wrong :(
> > > >
> > > > Thanx
> > > > Phil
> > > >
> > > >
> > > >
> > > > --
> > > > 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() failed: Permission denied

2002-09-28 Thread John W. Holmes

_YOU_ don't need write permissions, the web server does

---John Holmes...

> -Original Message-
> From: Phil Powell [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 4:24 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] mkdir() failed: Permission denied
> 
> Ok I did just that.. Permission is set for /users/ppowell/web/my at
0755
> giving me full write permissions onto that directory, I would think,
to
> create subdirectory /images.
> 
> However, I can't do that because I get the following error:
> 
> on line 27:
> if (!is_dir($path)) mkdir($path, 01755);
> 
> // $path = "/users/ppowell/web/my/images/";
> 
> Warning: Unable to access /users/ppowell/web/my/images/ in
> /users/ppowell/web/my/process.php on line 27
> 
> 
> 
> 
> Phil
> - Original Message -
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "'Phil Powell'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, September 28, 2002 4:22 PM
> Subject: RE: [PHP] mkdir() failed: Permission denied
> 
> 
> > Whatever user your web server is running as needs to have permission
to
> > write to that directory that you are trying to make the new one in.
> >
> > ---John Holmes...
> >
> > > -Original Message-
> > > From: Phil Powell [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, September 28, 2002 3:38 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] mkdir() failed: Permission denied
> > >
> > > Ok, I am stuck.  I am trying to create a folder in the same
directory
> > as
> > > process.php and then use
> > move_uploaded_file($FILES['myImage]['tmp_name'])
> > > and it constantly fails:
> > >
> > > mkdir() failed (Permission denied)
> > >
> > > Here is my code:
> > >
> > >  > >   $willChangeLayout = 1; $isEmptyLayoutValues = 1;
> > >
> > >   foreach ($_POST as $key => $val) {
> > >if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout =
0;
> > >if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
> > >${"$key"} = $val;
> > >   }
> > >
> > >   // SERVER-SIDE VALIDATION
> > >   if ($willChangeLayout && $isEmptyLayoutValues)
> > >header("Location: " . $refURL . "?errorMsg=" .
urlencode("Please
> > fill
> > > out
> > > all required fields"));
> > >
> > >   // FILE UPLOAD HANDLING
> > >
> > >   $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> > >
> > >   if (is_uploaded_file($_FILES['myImage']['tmp_name']))
> > >move_uploaded_file($_FILES['myImage']['tmp_name'],
> > > "/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
> > >
> > >
> > > ?>
> > >
> > > Please someone tell me what I'm doing wrong :(
> > >
> > > Thanx
> > > Phil
> > >
> > >
> > >
> > > --
> > > 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() failed: Permission denied

2002-09-28 Thread Sascha Braun

I've made many dirs:

$path_to_dir = '../';
  $images = 'images/';
  $year = date('Y').'/';
  $month = date('m').'/';
  $source = 'jpg/';
  $thumbs = 'thumbs/';
  $preview = 'preview/';
  $files = $HTTP_POST_FILES['image'];
  $path = $path_to_dir.$images.$year.$month.$source;
  if(!file_exists($path_to_dir.$images.$year)) {
   mkdir($path_to_dir.$images.$year, 0755);
   if(!file_exists($path_to_dir.$images.$year.$month)) {
mkdir($path_to_dir.$images.$year.$month, 0755);
if(!file_exists($path_to_dir.$images.$year.$month.$source)) {
 mkdir($path_to_dir.$images.$year.$month.$source, 0755);

But you need to be the owner of the dir where you want to create another dir
and the permissions have to allow you to make some dirs.

The abowe script doesn't work unless you close the if () { constructs.


> Ok, I'm confused.. tell me how to make a directory, please.
>
> Phil
> - Original Message -
> From: "Sascha Braun" <[EMAIL PROTECTED]>
> To: "Phil Powell" <[EMAIL PROTECTED]>
> Sent: Saturday, September 28, 2002 3:53 PM
> Subject: Re: [PHP] mkdir() failed: Permission denied
>
>
> > You have to be the owenr too and maybe set the permission to 755.
> >
> >
> > > Ok, I am stuck.  I am trying to create a folder in the same directory
as
> > > process.php and then use
> move_uploaded_file($FILES['myImage]['tmp_name'])
> > > and it constantly fails:
> > >
> > > mkdir() failed (Permission denied)
> > >
> > > Here is my code:
> > >
> > >  > >   $willChangeLayout = 1; $isEmptyLayoutValues = 1;
> > >
> > >   foreach ($_POST as $key => $val) {
> > >if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout = 0;
> > >if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
> > >${"$key"} = $val;
> > >   }
> > >
> > >   // SERVER-SIDE VALIDATION
> > >   if ($willChangeLayout && $isEmptyLayoutValues)
> > >header("Location: " . $refURL . "?errorMsg=" . urlencode("Please
fill
> > out
> > > all required fields"));
> > >
> > >   // FILE UPLOAD HANDLING
> > >
> > >   $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> > >
> > >   if (is_uploaded_file($_FILES['myImage']['tmp_name']))
> > >move_uploaded_file($_FILES['myImage']['tmp_name'],
> > > "/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
> > >
> > >
> > > ?>
> > >
> > > Please someone tell me what I'm doing wrong :(
> > >
> > > Thanx
> > > Phil
> > >
> > >
> > >
> > > --
> > > 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() failed: Permission denied

2002-09-28 Thread Phil Powell

Ok I did just that.. Permission is set for /users/ppowell/web/my at 0755
giving me full write permissions onto that directory, I would think, to
create subdirectory /images.

However, I can't do that because I get the following error:

on line 27:
if (!is_dir($path)) mkdir($path, 01755);

// $path = "/users/ppowell/web/my/images/";

Warning: Unable to access /users/ppowell/web/my/images/ in
/users/ppowell/web/my/process.php on line 27




Phil
- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Phil Powell'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, September 28, 2002 4:22 PM
Subject: RE: [PHP] mkdir() failed: Permission denied


> Whatever user your web server is running as needs to have permission to
> write to that directory that you are trying to make the new one in.
>
> ---John Holmes...
>
> > -Original Message-
> > From: Phil Powell [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 3:38 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] mkdir() failed: Permission denied
> >
> > Ok, I am stuck.  I am trying to create a folder in the same directory
> as
> > process.php and then use
> move_uploaded_file($FILES['myImage]['tmp_name'])
> > and it constantly fails:
> >
> > mkdir() failed (Permission denied)
> >
> > Here is my code:
> >
> >  >   $willChangeLayout = 1; $isEmptyLayoutValues = 1;
> >
> >   foreach ($_POST as $key => $val) {
> >if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout = 0;
> >if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
> >${"$key"} = $val;
> >   }
> >
> >   // SERVER-SIDE VALIDATION
> >   if ($willChangeLayout && $isEmptyLayoutValues)
> >header("Location: " . $refURL . "?errorMsg=" . urlencode("Please
> fill
> > out
> > all required fields"));
> >
> >   // FILE UPLOAD HANDLING
> >
> >   $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> >
> >   if (is_uploaded_file($_FILES['myImage']['tmp_name']))
> >move_uploaded_file($_FILES['myImage']['tmp_name'],
> > "/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
> >
> >
> > ?>
> >
> > Please someone tell me what I'm doing wrong :(
> >
> > Thanx
> > Phil
> >
> >
> >
> > --
> > 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() failed: Permission denied

2002-09-28 Thread John W. Holmes

Whatever user your web server is running as needs to have permission to
write to that directory that you are trying to make the new one in.

---John Holmes...

> -Original Message-
> From: Phil Powell [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 3:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] mkdir() failed: Permission denied
> 
> Ok, I am stuck.  I am trying to create a folder in the same directory
as
> process.php and then use
move_uploaded_file($FILES['myImage]['tmp_name'])
> and it constantly fails:
> 
> mkdir() failed (Permission denied)
> 
> Here is my code:
> 
>$willChangeLayout = 1; $isEmptyLayoutValues = 1;
> 
>   foreach ($_POST as $key => $val) {
>if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout = 0;
>if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
>${"$key"} = $val;
>   }
> 
>   // SERVER-SIDE VALIDATION
>   if ($willChangeLayout && $isEmptyLayoutValues)
>header("Location: " . $refURL . "?errorMsg=" . urlencode("Please
fill
> out
> all required fields"));
> 
>   // FILE UPLOAD HANDLING
> 
>   $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> 
>   if (is_uploaded_file($_FILES['myImage']['tmp_name']))
>move_uploaded_file($_FILES['myImage']['tmp_name'],
> "/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
> 
> 
> ?>
> 
> Please someone tell me what I'm doing wrong :(
> 
> Thanx
> Phil
> 
> 
> 
> --
> 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()

2001-11-28 Thread Andrey Hristov

May be your httpd is running under nobody.nobody but the owner of the htdocs dir, or 
wherever are running your php scripts is owned
by someone else.

Regards,
Andrey Hristov
- Original Message -
From: "Christoph Starkmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 12:32 PM
Subject: [PHP] mkdir()


> Hi there!
>
> I got the following problem:
>
> I want to "mirror" a complete directory tree. Now I traverse
> the original tree, do changes to some of the files and want to
> write the resulting files to a parallel directory.
>
> Lets say $INPUT_PATH is the source path and $OUTPUT_PATH is
> where I want to put the copies.
> $file is the path o the current file.
>
> Now I tried to do the following:
>
> file://...snip...
>
> $outfileName = ereg_replace($INPUT_PATH, $OUTPUT_PATH, $file);
> $OUTFILE = fopen($outfileName, "w") || die ("Oooops, couldn't open $file);
>
> // ... more blahblah...
>
> fclose($OUTFILE);
>
> But now I got an error:
>
> Warning: fopen("path/directory/template.html","w") - No such file or
> directory in filename.php on line 231
>
> Okay, I hoped PHP would create the directory, too, along with creating
> the file Iwant to write to when it doesn't exist.
>
> When I try to create the directory "manually" using
>
> mkdir("path/directory", 0777) || die ("Yet another ugly death...");
>
> I get yet another ugly error:
>
> Warning: MkDir failed (No such file or directory) in filename.php on line 29
>
> Why is this? Of course there is no such file or directory... If there was, I
> wouldn't have to create one ;)
>
> Any ideas? Hints?
>
> Every tidy bit of wisom is appreciated...
>
> Cheers,
>
> Kiko
>
> -
> It's not a bug, it's a feature.
> christoph starkmann
> mailto:[EMAIL PROTECTED]
> http://www.fh-augsburg.de/~kiko
> ICQ: 100601600
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MKDIR Permission Denied

2001-10-25 Thread Kurt Lieber

On Thursday 25 October 2001 11:41, you wrote:
> How do I set permissions for a certain user (ie nobody) for a directory?
> If I do this, won't anyone on teh server be able to write to that
> directory?

If you're going to start messing around with *nix permissions, you really, 
really need to have a basic understanding of how they work.  Otherwise, you 
can get into a lot of trouble really quickly.  There's a ton of tutorials 
around the net; here's one that I've found helpful in the past:

http://www.linuxdoc.org/HOWTO/Security-HOWTO-5.html
(it's part of a larger linux security HOWTO)

As for your second question, yes.  That's one of the side-effects of using a 
shared server.

--kurt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MKDIR Permission Denied

2001-10-25 Thread Jeff Gannaway

How do I set permissions for a certain user (ie nobody) for a directory?
If I do this, won't anyone on teh server be able to write to that directory?

Thanks,
Jeff

At 10:39 AM 10/25/01 -0700, Kurt Lieber wrote:
>On Thursday 25 October 2001 10:08, you wrote:
>> > $GalleryPHPName = "Pins";
>> mkdir ("../$GalleryPHPName", "0775");
>> ?>
>>
>> Results in...
>>
>> MkDir failed (Permission denied)
>
>When you use a file-related command (fopen, mkdir, etc.) you're executing 
>that command under the same user-context that apache runs under. (usually 
>"nobody" on shared servers)  So, you need to make sure that user "nobody"
has 
>write permissions on the parent directory where you're trying to create your 
>directory.
>
>--kurt
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
___

Save 15% on 2002 Calendars and Holiday Cards!

http://www.AvantGifts.com
Discount Code: hopper22ct
Offer Good Through October 31, 2001
___ 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MKDIR Permission Denied

2001-10-25 Thread Chuck Theobald

Jeff,

If this script is running as nobody, or some other low-class user, and the
permissions on the directory in which you are attempting to create a
sub-directory do not allow the creation of the sub-directory by this user,
then mkdir will fail.

Say your script resides in 'php-stuff' with permissions 755 and the
owner/group is chuck/chuck.  No one but owner chuck (and root) will be able
to create a directory in this directory.  According to your script, you are
trying to create 'php-stuff/Pins', which is disallowed to 'nobody', the
typical user of web-based PHP scripts.

Chuck


At 10:08 AM -0700 10/25/01, Jeff Gannaway wrote:
>$GalleryPHPName = "Pins";
>mkdir ("../$GalleryPHPName", "0775");
>?>
>
>Results in...
>
>MkDir failed (Permission denied)
>
>Any thoughts?
>
>-Jeff Gannaway
>___
>
>Save 15% on 2002 Calendars and Holiday Cards!
>
>http://www.AvantGifts.com
>Discount Code: hopper22ct
>Offer Good Through October 31, 2001
>___
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


Chuck Theobald, Technology Manager
ERIC Clearinghouse on Educational Management
5207 University of Oregon, Eugene, OR, 97403-5207
800-438-8841
* 541-346-1662 (voice) * 541-346-2334  (fax) * 541-337-0182 (cell) *
* http://eric.uoregon.edu/ * mailto:[EMAIL PROTECTED] *



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MKDIR Permission Denied

2001-10-25 Thread Mike Eheler

a) check to see if the user that apache is running as has access to the 
directory you're trying to write to.
b) try removing the quotes around 0775

Mike

Jeff Gannaway wrote:

>$GalleryPHPName = "Pins";
>mkdir ("../$GalleryPHPName", "0775");
>?>
>
>Results in...
>
>MkDir failed (Permission denied)
>
>Any thoughts?
>
>-Jeff Gannaway
>___
>
>Save 15% on 2002 Calendars and Holiday Cards!
>
>http://www.AvantGifts.com
>Discount Code: hopper22ct
>Offer Good Through October 31, 2001
>___ 
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MKDIR Permission Denied

2001-10-25 Thread Kurt Lieber

On Thursday 25 October 2001 10:08, you wrote:
>  $GalleryPHPName = "Pins";
> mkdir ("../$GalleryPHPName", "0775");
> ?>
>
> Results in...
>
> MkDir failed (Permission denied)

When you use a file-related command (fopen, mkdir, etc.) you're executing 
that command under the same user-context that apache runs under. (usually 
"nobody" on shared servers)  So, you need to make sure that user "nobody" has 
write permissions on the parent directory where you're trying to create your 
directory.

--kurt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mkdir Question

2001-08-26 Thread Javi - NeoDigit

I 've the same problem and I haven´t the solucion so far.
I need to create a file with the correct owner, "nobody" is not usefull at
all.

Chown and chmod are not the solution, the solution is create the dir or the
file directly with the real owner, I saw a script to do that but I can´t
find it again and I´m working in it but I can´t solve it.

If somebody knows the solution I'd apreciate so much to know it

Javi


Chris Lambert <[EMAIL PROTECTED]> escribió en el mensaje de noticias
006901c12e7a$3f566940$[EMAIL PROTECTED]
> Setting the file to have 0777 permissions will allow you to read and write
> it from any user on the system. However, it doesn't allow you to change
the
> ownership (or the permissions) unless you're its creator. Giancula
suggested
> chowning the file from within your PHP script, as you're still directing
> from user "nobody".
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: Jeff Oien <[EMAIL PROTECTED]>
> To: PHP <[EMAIL PROTECTED]>
> Sent: Sunday, August 26, 2001 4:41 PM
> Subject: RE: [PHP] mkdir Question
>
>
> | However even the permission of 0777 doesn't let me do anything to
> | the directory or files in it. I can't even chown or chmod anything in
> | it using Telnet once it's created.
> | Jeff Oien
> |
> | > Jeff
> | > JO> mkdir ("/usr/www/users//blah/blah/$username", 0777);
> | > JO> it sets it to nobody instead of my username.
> | > "Nobody" is the user runng the Apache process that's why it is the
owner
> | > of the directory.
> | > You can "chown" the direcotry from your PHP script after you create
> | > it or "chmod" the files you copy there.
> | >
> | > Cheers,
> | >Gianluca
> | >
> | >
> | > JO> I'm then unable
> | > JO> to delete or modify files in that directory. Is there a way around
> | > JO> this? Thanks.
> | > JO> Jeff Oien
> | >
> | >
> | >
> | >
> | > --
> | > ALBASOFTWARE
> | > C/ Mallorca 186 - 3º 1ª
> | > 08036 Barcelona (Spain)
> | > Tel. +34 93454009 - +34 934549324
> | > Fax. +34 934541979
> | > @@ ICQ 47323154 @@
> | > [EMAIL PROTECTED]
> | > http://www.albasoftware.com
> | > http://www.phpauction.org
> | > http://www.gianlucabaldo.com
> | >
> | >
> | > --
> | > PHP General Mailing List (http://www.php.net/)
> | > To unsubscribe, e-mail: [EMAIL PROTECTED]
> | > For additional commands, e-mail: [EMAIL PROTECTED]
> | > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> | >
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> |
> |
> |
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mkdir Question

2001-08-26 Thread Chris Lambert

Setting the file to have 0777 permissions will allow you to read and write
it from any user on the system. However, it doesn't allow you to change the
ownership (or the permissions) unless you're its creator. Giancula suggested
chowning the file from within your PHP script, as you're still directing
from user "nobody".

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Jeff Oien <[EMAIL PROTECTED]>
To: PHP <[EMAIL PROTECTED]>
Sent: Sunday, August 26, 2001 4:41 PM
Subject: RE: [PHP] mkdir Question


| However even the permission of 0777 doesn't let me do anything to
| the directory or files in it. I can't even chown or chmod anything in
| it using Telnet once it's created.
| Jeff Oien
|
| > Jeff
| > JO> mkdir ("/usr/www/users//blah/blah/$username", 0777);
| > JO> it sets it to nobody instead of my username.
| > "Nobody" is the user runng the Apache process that's why it is the owner
| > of the directory.
| > You can "chown" the direcotry from your PHP script after you create
| > it or "chmod" the files you copy there.
| >
| > Cheers,
| >Gianluca
| >
| >
| > JO> I'm then unable
| > JO> to delete or modify files in that directory. Is there a way around
| > JO> this? Thanks.
| > JO> Jeff Oien
| >
| >
| >
| >
| > --
| > ALBASOFTWARE
| > C/ Mallorca 186 - 3º 1ª
| > 08036 Barcelona (Spain)
| > Tel. +34 93454009 - +34 934549324
| > Fax. +34 934541979
| > @@ ICQ 47323154 @@
| > [EMAIL PROTECTED]
| > http://www.albasoftware.com
| > http://www.phpauction.org
| > http://www.gianlucabaldo.com
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mkdir Question

2001-08-26 Thread Jeff Oien

However even the permission of 0777 doesn't let me do anything to
the directory or files in it. I can't even chown or chmod anything in
it using Telnet once it's created.
Jeff Oien

> Jeff
> JO> mkdir ("/usr/www/users//blah/blah/$username", 0777);
> JO> it sets it to nobody instead of my username.
> "Nobody" is the user runng the Apache process that's why it is the owner
> of the directory.
> You can "chown" the direcotry from your PHP script after you create
> it or "chmod" the files you copy there.
>
> Cheers,
>Gianluca
>
>
> JO> I'm then unable
> JO> to delete or modify files in that directory. Is there a way around
> JO> this? Thanks.
> JO> Jeff Oien
>
>
>
>
> --
> ALBASOFTWARE
> C/ Mallorca 186 - 3º 1ª
> 08036 Barcelona (Spain)
> Tel. +34 93454009 - +34 934549324
> Fax. +34 934541979
> @@ ICQ 47323154 @@
> [EMAIL PROTECTED]
> http://www.albasoftware.com
> http://www.phpauction.org
> http://www.gianlucabaldo.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mkdir Question

2001-08-26 Thread Gianluca Baldo

Jeff
JO> mkdir ("/usr/www/users//blah/blah/$username", 0777);
JO> it sets it to nobody instead of my username.
"Nobody" is the user runng the Apache process that's why it is the owner
of the directory.
You can "chown" the direcotry from your PHP script after you create
it or "chmod" the files you copy there.

Cheers,
   Gianluca

   
JO> I'm then unable 
JO> to delete or modify files in that directory. Is there a way around
JO> this? Thanks.
JO> Jeff Oien




--
ALBASOFTWARE
C/ Mallorca 186 - 3º 1ª
08036 Barcelona (Spain)
Tel. +34 93454009 - +34 934549324
Fax. +34 934541979
@@ ICQ 47323154 @@
[EMAIL PROTECTED]
http://www.albasoftware.com
http://www.phpauction.org
http://www.gianlucabaldo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mkdir

2001-07-30 Thread Jerry Lake

I can create single directories,
just not subdirectories. and only in
the directory the script is in
I'm guessing that it may be a permission
issue ...?

Jerry Lake  
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 28, 2001 7:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mkdir


On Sat, 28 Jul 2001, Jerry Lake wrote:

> when using mkdir
> I cant seem to make subdirectories
>  $oldumask = umask(0);
> mkdir('test/test', 0777);
> umask($oldumask);
> ?>
> 
> is there any way to do this ?

does the first test directory already exist? you may need to make them in
two steps. i believe mkidir has a switch to force it to create any needed
directories along the way.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mkdir

2001-07-28 Thread mike cullerton

On Sat, 28 Jul 2001, Jerry Lake wrote:

> when using mkdir
> I cant seem to make subdirectories
>  $oldumask = umask(0);
> mkdir('test/test', 0777);
> umask($oldumask);
> ?>
> 
> is there any way to do this ?

does the first test directory already exist? you may need to make them in
two steps. i believe mkidir has a switch to force it to create any needed
directories along the way.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mkdir

2001-07-28 Thread Michael Hall

This type of problem usually turns out to be a permissions issue.
Can Apache/nobody write to the parent directory?

Mick

On Sat, 28 Jul 2001, Jerry Lake wrote:
> when using mkdir
> I cant seem to make subdirectories
>  $oldumask = umask(0); 
> mkdir('test/test', 0777);
> umask($oldumask);
> ?>
> 
> is there any way to do this ?
> 
> Jerry Lake 
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online   - http://www.pacifier.com
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
Michael Hall
mulga.com.au
[EMAIL PROTECTED]
ph/fax (+61 8) 8953 1442
ABN 94 885 174 814

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MkDir failed (Permission denied)

2001-03-10 Thread Colin May

Quoting Dan Pupek (Sat, Mar 10, 2001 at 02:49:40PM -0600)
> I am pretty new to PHP but have used other scripting languages. I am trying
> to use to mkdir() function on an apache server and keep getting this  error
> MkDir failed (Permission denied). I don't have physical access to the
> server.
> 
> What's up?

Depends what directory you are trying to create, and if the permissions of 
the parent directory allows you to do, based on the user apache is running 
as.  Usually, most people dont run apache as root, normally the "nobody" 
user.   "nobody" tends not to be able to mkdir's unless someone has 
chown'd/chmod'd a parent directory accordingly.

Colin. 

-- 

Colin May  | "its an illusion, its a game, a reflection of
mailto:[EMAIL PROTECTED]  | someone elses name" - abacab, genesis
http://www.wibble.org.uk   | http://www.abacab.org.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]