Reply to Re: Chmod

Your name:

Reply:


Posted by frizzle on 04/18/06 12:55

Jerry Stuckle wrote:
> frizzle wrote:
> > Jerry Stuckle wrote:
> >
> >>frizzle wrote:
> >>
> >>>Jerry Stuckle wrote:
> >>>
> >>>
> >>>>frizzle wrote:
> >>>>
> >>>>
> >>>>>I asked my webhost, but they told me uploading
> >>>>>a folder and having it running uploads etc. is not
> >>>>>possible on Linux by default. Folders should be
> >>>>>chmod 777 or chmod 755.
> >>>>>
> >>>>>Frizzle.
> >>>>>
> >>>>
> >>>>Yes and no. It depends on how they have their folders configured.
> >>>>
> >>>>However, obviously they have it configured so you can't do it. But you should
> >>>>still be able to create the folder in PHP from a web page (so it's running as
> >>>>the Apache user) and upload to it. The folder should then have the Apache user
> >>>>as the owner.
> >>>>
> >>>>--
> >>>>==================
> >>>>Remove the "x" from my email address
> >>>>Jerry Stuckle
> >>>>JDS Computer Training Corp.
> >>>>jstucklex@attglobal.net
> >>>>==================
> >>>
> >>>
> >>>AFAIK the script below should be able to create dirs then
> >>>but i get the following error:
> >>>
> >>>Warning: mkdir(testdir): Permission denied in
> >>>/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php on line 5
> >>>
> >>>Warning: Cannot modify header information - headers already sent by
> >>>(output started at
> >>>/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php:5) in
> >>>/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php on line 6
> >>>
> >>>Frizzle.
> >>>
> >>>+++++++++++++++++++++++++++++++++++++++++++++++++++
> >>>
> >>><?php
> >>>
> >>> if(isset( $_POST['dir'] ))
> >>> {
> >>> mkdir( $_POST['dir'], 0755 );
> >>> header('Location: '.$PHP_SELF);
> >>> };
> >>>
> >>>
> >>>?><form action="<?php echo $PHP_SELF; ?>" method="post"
> >>>name="mkdirtest" target="_top" id="mkdirtest">
> >>> <label for="dir">dir</label>
> >>> <input type="text" name="dir" id="dir"<?php echo isset( $_POST['dir']
> >>>) ? ' value="'.$_POST['dir'].'"' : '' ?>>
> >>> <label for="Submit"></label>
> >>> <input type="submit" name="Submit" value="mkdir!" id="Submit">
> >>></form><?php
> >>>
> >>>$handle = opendir('.');
> >>>
> >>>while (false !== ($file = readdir($handle))) {
> >>> if ($file != "." && $file != ".." ) {
> >>> echo $file.'<br>';
> >>> };
> >>>};
> >>>
> >>>closedir( $handle );
> >>>
> >>>?>
> >>>
> >>What happens if you leave off the 0755? That may be restricted in your
> >>location. Just try it with the default.
> >>
> >>If it still doesn't work, looks like it's time to find another host. This one
> >>has too many restrictions.
> >>
> >>
> >>--
> >>==================
> >>Remove the "x" from my email address
> >>Jerry Stuckle
> >>JDS Computer Training Corp.
> >>jstucklex@attglobal.net
> >>==================
> >
> >
> > Hmm, that's really crap. 755 does nothing more, and changing hosts
> > isn't really an option. ... :(
> >
> > Frizzle.
> >
>
> But unfortunately, it looks like your host has too many things locked down for
> you to be able to upload files through the website.
>
> I can partially understand their reasoning in a shared environment. But at the
> same time, other hosting companies can do it. So why can't they?
>
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================

I guess you're right, but i really really don't want to change hosts. I
have multiple
sites hosted there, knowing their service etc. is great. (And still is)
This is the
first kind of problem i've come across.

I mailed them with my problem, and saying i don't want to swich, and if
they can
come up with another solution. If not, then i'll see ...

I looked into another old site on one of their servers wich was meant
as an online
diary with a photo gallery. I created an upload-module for photos.
These were
automatically resized by PHP. Looking through Plesk's file manager, i
can see the
folder the pics end up in is chmodded rwx r-x r-x (755), pics are rw-
r-- r-- (644)

Pics and folder have the same owner, and belong to the same group. Pics
are as
i said PHP created, the folder was done in dreamweaver, but probably
chmodded
manually. I wonder if this is possible for other files then images,
because they
don't have to be resampled, so aren't actually created by PHP.

I hope you get what i'm saying.

Frizzle.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация