Re: [PHP] PHP Apache Upload file Permission denied

2004-12-16 Thread Raditha Dissanayake
Michael Leung wrote:
Hi All,
  My problem is finally solved by totally off SELinux Security
Policies.
I told you so :-))
Thank you very verry much the helps from yours! I know this
is not very safe solution, but at the leasy my script can work
 


yours,
Michael
 


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] PHP Apache Upload file Permission denied

2004-12-15 Thread Michael Leung
Hi All,
   My problem is finally solved by totally off SELinux Security
Policies. Thank you very verry much the helps from yours! I know this
is not very safe solution, but at the leasy my script can work


yours,
Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-14 Thread Michael Leung
Yes, I have restarted my Apache.

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-14 Thread Richard Lynch
Michael Leung wrote:
Yes, apache can do read/write in /tmp.  I can't su to apache.
 But I created  another account in apache group(userid test1). I have
 such tests by using that account. I can do mv , cp , create new file.
 After those successful test, I have  modified httpd.conf to make
 apache web server run as test1. But they are still working like the
 same error.

You re-started Apache, right?...

Just to be sure, does ?php phpinfo();? show 'test1' as the user?

If so, check http://bugs.php.net for your OS/PHP version and bugs related
to file upload:  If the user running PHP can do all that stuff, PHP should
be able to do it with no problem.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


Re: [PHP] PHP Apache Upload file Permission denied

2004-12-13 Thread Richard Lynch
Michael Leung wrote:
I have faced the upload file permission denied for weeks. I can't
 write a new file/create a directory. I did a test in PHP standalone
 (Linux shell).  The operation is very normal.

But what *USER* were you when you did that test?!

Were you the same user PHP runs as, IE, the user Apache runs as?

If not, your test is meaningless.

If you were root, your test is beyond meaningless, bordering on the
ridiculous :-)

 But in web environment, I got this error message:

 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
 move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
 /var/www/html/simple_upload.php on line 76.

 I think this is a problem bewteen Apache and PHP. The safe mode of PHP
 is off and test directory is changed to 777.

Are you 100% certain you have the directory names correct?

Can the PHP user *READ* /tmp/* files?
Can the PHP user *WRITE* /var/www/htm/test/* files?



-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-13 Thread Michael Leung
Hi all,
the user is apache for PHP. the directory is owned by apache user.
I am 100% certain for the directory name.

yours,
Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-13 Thread Richard Lynch
And apache user can read/write /tmp?

What files are in /tmp?

su to apache and see if you can read the uploaded files, and mv them to
the directory.

Michael Leung wrote:
 Hi all,
 the user is apache for PHP. the directory is owned by apache user.
 I am 100% certain for the directory name.

 yours,
 Michael

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-13 Thread Michael Leung
Hi,
   Yes, apache can do read/write in /tmp.  I can't su to apache.
But I created  another account in apache group(userid test1). I have
such tests by using that account. I can do mv , cp , create new file. 
After those successful test, I have  modified httpd.conf to make 
apache web server run as test1. But they are still working like the
same error.

yours,
Michael

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



[PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Michael Leung
Hi all,
   I have faced the upload file permission denied for weeks. I can't
write a new file/create a directory. I did a test in PHP standalone
(Linux shell).  The operation is very normal.
But in web environment, I got this error message:

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
/var/www/html/simple_upload.php on line 76.

I think this is a problem bewteen Apache and PHP. The safe mode of PHP
is off and test directory is changed to 777.

yours,
Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Andre Dubuc
Dear Michael,

I spent the better part of today trying to get a file upload script to work 
too. Same sort of problem: local linux works ok, but web - nope.

Looking at your error message, it might be the renaming of the temp file that 
is barfing.

if (($_FILES[pix][size]  0)($_FILES[pix][size]  75000)){

if ($_FILES[pix][type] == image/jpeg)
{
$pix_file = $_FILES[pix][name];
$pix_temp_file = $_FILES[pix][tmp_name];

$new_pix_file = -5.jpg;

if(is_uploaded_file($pix_temp_file)){
move_uploaded_file($pix_temp_file, pix/$new_pix_file);
}
}
}
else {

print brbrbrbrbigbPicture Upload 
Errorb/bigbrbrh5Filesize is greater than maximum 75k!brbr 
Please resize your picture to below 75k, and try again!/h5br;
}

This works for me -- might want to modify it and see if it clicks on yours. My 
pix directory is 777, uploaded files go in as apache:apache 755. (also, if 
you try to upload greater than limit set in apache, nothing will show up in 
'/var/www/htm/test/icons.zip'.
  ^

Btw, is that a typo: 'htm' or did you want 'html'??

Hth,
Andre

On Sunday 12 December 2004 07:46 pm, Michael Leung wrote:
 Hi all,
I have faced the upload file permission denied for weeks. I can't
 write a new file/create a directory. I did a test in PHP standalone
 (Linux shell).  The operation is very normal.
 But in web environment, I got this error message:

 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
 move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
 /var/www/html/simple_upload.php on line 76.

 I think this is a problem bewteen Apache and PHP. The safe mode of PHP
 is off and test directory is changed to 777.

 yours,
 Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Michael Leung
Hi Andre,
  thank you, I have hided my html path in the message. I have replace 
my real path with '/var/www/html/'.  the error message should be like
this.
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
  move '/tmp/phpjsLZfC' to '/var/www/html/test/icons.zip' in
  /var/www/html/simple_upload.php on line 76.
Pervious error message , I have some typing mistakes in there.

Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.
The script does not work any more. I am thinking may be I need to
modify some configure in Apache 2 to allow the upload file function.

yours,
Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Travis Conway
Ha!
Sorry for that Fedora 3 is causing all kinds of havoc. I would stay away 
for a while.

Trav
- Original Message - 
From: Michael Leung [EMAIL PROTECTED]
To: Andre Dubuc [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 7:25 PM
Subject: Re: [PHP] PHP Apache Upload file Permission denied


Hi Andre,
 thank you, I have hided my html path in the message. I have replace
my real path with '/var/www/html/'.  the error message should be like
this.
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
 move '/tmp/phpjsLZfC' to '/var/www/html/test/icons.zip' in
 /var/www/html/simple_upload.php on line 76.
Pervious error message , I have some typing mistakes in there.
Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.
The script does not work any more. I am thinking may be I need to
modify some configure in Apache 2 to allow the upload file function.
yours,
Michael
--
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] PHP Apache Upload file Permission denied

2004-12-12 Thread Michael Leung
Hi all,
  I am more believing this is a kind of apache configure problem. If
that's Fedora 3 problem, I can't do this kind in command line.
Therefore, if I bypassed Apache, my problem is solved. Moreover, my
system is highly OOP , I can't fall back into PHP 4.


yours,
Michael

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



Re: [PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Raditha Dissanayake

Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.
 

Then as I mentioned in my previous mail SELinux is to blame. Uninstall 
it or disable it. (pass selinux=0 when you boot).

 


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] PHP Apache Upload file Permission denied

2004-12-12 Thread Travis Conway
What user did you run your command line as?
Trav
- Original Message - 
From: Michael Leung [EMAIL PROTECTED]
To: Travis Conway [EMAIL PROTECTED]
Cc: Andre Dubuc [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 8:01 PM
Subject: Re: [PHP] PHP Apache Upload file Permission denied


Hi all,
 I am more believing this is a kind of apache configure problem. If
that's Fedora 3 problem, I can't do this kind in command line.
Therefore, if I bypassed Apache, my problem is solved. Moreover, my
system is highly OOP , I can't fall back into PHP 4.
yours,
Michael
--
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] PHP Apache Upload file Permission denied

2004-12-12 Thread Raditha Dissanayake
Michael Leung wrote:
Hi all,
  I have faced the upload file permission denied for weeks. I can't
write a new file/create a directory. I did a test in PHP standalone
(Linux shell).  The operation is very normal.
But in web environment, I got this error message:
 

Something that just occurred to me?
do you have SELinux installed?
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
/var/www/html/simple_upload.php on line 76.
I think this is a problem bewteen Apache and PHP. The safe mode of PHP
is off and test directory is changed to 777.
yours,
Michael
 


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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