Re: [PHP] Relative beginner in dire need of help! (Scratch my last message, sorry... )
Are you sure the permissions on the directory are set up correctly? The user that the db is run as (usually nobody in apache/linux) needs read and write privileges on that directory ed At 04:30 AM 5/29/2002 -0400, [EMAIL PROTECTED] wrote: >I really hope someone can help me here!! LOL!! > >I'm in the process of moving a site that utilises PHP and MySQL to another >server. The move has gone well, and I have successfully edited most of the >scripts, or rewritten them to work in their new location... however... I am >having a problem with this one... > >It's a script (written by someone else) to upload special offers to a DB. >Simple so far... well, it includes an image upload section. The script seems >to automatically grab and store the name, height, width, etc of the image. >I'm getting two major errors: > >Warning: Unable to create '../specialoffer_images/specoffpicone.jpg': >Permission denied in >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > > >ged.php on line 45 > >Warning: Cannot add header information - headers already sent by (output >started at >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > > >ged.php:45) in >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > >ged.php on line 82 > >The directories are permissiond correctly, and I've tried so many different >ways to point the the locations... Here's the sections that I seem to have >probs with: > >if($specoffpicone != "none"){ >copy($specoffpicone, $complete_image_one); >} >if($specoffpictwo != "none"){ >copy($specoffpictwo, $complete_image_two); >} >if($specoffpicthree != "none"){ >copy($specoffpicthree, $complete_image_three); >} > >and > >header("Location: ../special_offers.php"); > >The directory is referenced like this: > >$dir = "../specialoffer_images/"; > >I know this is a long mail, but I've been trying all sorts, and searching all > >over for clues, and I'm extremely tired, frsutrated, and very stuck. I need a > >helping hand, please!! If you need/want to see the whole script, just ask, >it's not too big. > >Regards, > >Greg Watson > > > >-- >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] Relative beginner in dire need of help! (Scratch my last message, sorry... )
> > Warning: Unable to create > > '../specialoffer_images/specoffpicone.jpg': Permission denied in > > > /home/virtual/loverskey/home/httpd/html/specialoffer_admin/sp > ecial_off > > ers_changed.php on line 45 > > The directories are permissiond correctly, and I've tried so many > Nope, they can't be. Otherwise you wouldn't get 'permission > denied' Go to that directory and try: > > chmod 777 the_problem_dir The problem may well be that it's a parent directory without the appropriate permissions. You need to give the web server user (on unix it's often nobody or apache or some such) access to the entire directory tree up to an including the directory where you want to store the file. > Should work though someone else can probably tell you and me > how to avoid the 777 securtity risk that will cause ;-) For every directory except the one that you actually want to create the files in you can use 755 instead. This has the effect of letting people 'cd' to the directory but little else. Then on the actual directory where files are created you make it 777. It's still a potential security problem but a smaller one than having the whole tree wide open. Actually, thinking about it, 744 might even let you do it - if I recall, you basically only need to give execute permissions to let someone into the directory but need read permissions to let them view contents. The key is that it _MUST_ include the entire tree that gets you to that directory. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Relative beginner in dire need of help! (Scratch my last message, sorry... )
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then [EMAIL PROTECTED] declared > Warning: Unable to create > '../specialoffer_images/specoffpicone.jpg': Permission denied in > /home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_off > ers_changed.php on line 45 > The directories are permissiond correctly, and I've tried so many Nope, they can't be. Otherwise you wouldn't get 'permission denied' Go to that directory and try: chmod 777 the_problem_dir Should work though someone else can probably tell you and me how to avoid the 777 securtity risk that will cause ;-) Nick - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE89JPVHpvrrTa6L5oRAvGUAJ9KIMp0q/eeG4/noOhm+xl2HP17IACfZzbL s0VIa121rsYS3v1znWxKOBM= =eiI9 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php