473,378 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Permissions in PHP

Hi! I have a script designed to read a number of
images and make thumbnails of them. These thumbnails are stored in
/thumbs/ as tn_filename.jpg. And so apache needs permissions to
write in ./ so it kan create thumbs and the files therein.
But I also want to upload pictures directly to ./ with
FTP/SSH without logging in as apache.

I have tried with groups but then I need some kind of default
permission on all files in the subdirectories.

So... any tips?

--
Martin Isaksson
ma******@dd.chalmers.se

The church saves sinners, but science seeks to stop their manufacture.
-- Elbert Hubbard
Jul 16 '05 #1
6 2335
Martin Isaksson wrote:
Hi! I have a script designed to read a number of
images and make thumbnails of them. These thumbnails are stored in
/thumbs/ as tn_filename.jpg. And so apache needs permissions to
write in ./ so it kan create thumbs and the files therein.
But I also want to upload pictures directly to ./ with
FTP/SSH without logging in as apache.

I have tried with groups but then I need some kind of default
permission on all files in the subdirectories.

So... any tips?

chmod 777 uploaddir/
chmod 666 uploaddir/*
Jul 16 '05 #2
On Mon, 08 Sep 2003 12:05:30 +0100 in
<message-id:Xn*****************@stones.force9.net>
Matty <ma*******@askmenoquestions.co.uk> wrote:
> I have tried with groups but then I need some kind of default
> permission on all files in the subdirectories.
>
> So... any tips?
>

chmod 777 uploaddir/
chmod 666 uploaddir/*

Matty..

Just out of curiousity and off topic really for here.. but have you ever
looked at mod_become for Apache? I've had a few people ask me the same
questions for shared hosting.. and while I'm in the middle of writing a
control panel application that'll include a filemanager and will get
over this issue anyway, I was wondering if you'd had any experience with
mod_become to handle issues of this nature too.

Just a passing thought while I was on snert.com earlier =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.
Jul 16 '05 #3
Ian.H [dS] wrote:
Matty..

Just out of curiousity and off topic really for here.. but have you ever
looked at mod_become for Apache? I've had a few people ask me the same
questions for shared hosting.. and while I'm in the middle of writing a
control panel application that'll include a filemanager and will get
over this issue anyway, I was wondering if you'd had any experience with
mod_become to handle issues of this nature too.

Just a passing thought while I was on snert.com earlier =)


I haven't actually - normally I've tried to avoid this kind of thing, but I'll
have a look (know a few people who might have worked with it a bit!)
Jul 16 '05 #4
On Mon, 08 Sep 2003 13:55:02 +0100 in
<message-id:E_*****************@stones.force9.net>
Matty <ma*******@askmenoquestions.co.uk> wrote:
I was wondering if you'd had any experience with
> mod_become to handle issues of this nature too.
>
> Just a passing thought while I was on snert.com earlier =)


I haven't actually - normally I've tried to avoid this kind of thing,
but I'll have a look (know a few people who might have worked with it
a bit!)

Thanks.. would be appreciated.

I did look into suExec etc, but my PHP install is configured as a
module, thus suExec has no effect.

I thought about using sudo for some things too (not "by users" as such)
but this then provokes a global security issue of who can access what
via the server userID etc.

Out of curiousity again, what makes you try and avoid this sort of
thing? I'm assuming permissions / security of some kind. I've not
thought about it until recently and have always used the "normal"
methods for the years of using PHP.. but thought it looked possibly
interesting =)

Thanks again.......

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.
Jul 16 '05 #5
In article <Xn*****************@stones.force9.net>,
Matty <ma*******@askmenoquestions.co.uk> writes:
Martin Isaksson wrote:
Hi! I have a script designed to read a number of
images and make thumbnails of them. These thumbnails are stored in
/thumbs/ as tn_filename.jpg. And so apache needs permissions to
write in ./ so it kan create thumbs and the files therein.
But I also want to upload pictures directly to ./ with
FTP/SSH without logging in as apache.

I have tried with groups but then I need some kind of default
permission on all files in the subdirectories.

So... any tips?

chmod 777 uploaddir/
chmod 666 uploaddir/*


Well this means that all users on my server are able to do things in there...
Not good...

--
Martin Isaksson
ma******@dd.chalmers.se

The purpose of Physics 7A is to make the engineers realize that they're
not perfect, and to make the rest of the people realize that they're not
engineers.
Jul 16 '05 #6
Martin Isaksson wrote:
In article <Xn*****************@stones.force9.net>,
Matty <ma*******@askmenoquestions.co.uk> writes:
Martin Isaksson wrote:
Hi! I have a script designed to read a number of
images and make thumbnails of them. These thumbnails are stored in
/thumbs/ as tn_filename.jpg. And so apache needs permissions to
write in ./ so it kan create thumbs and the files therein.
But I also want to upload pictures directly to ./ with
FTP/SSH without logging in as apache.

I have tried with groups but then I need some kind of default
permission on all files in the subdirectories.

So... any tips?

chmod 777 uploaddir/
chmod 666 uploaddir/*


Well this means that all users on my server are able to do things in
there...


Not necessarily. If their default group is the same as yours, then
doing chmod 705 on your home directory will make it inaccessible to
people in the same group as you, whilst making it accessible to the
webserver process, which (presumably) is running as nobody.
Jul 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Kim Lots | last post by:
Hi Sorry to disturb you again but i really like to know what's the NTFS folder permissions on a "virtual directory" folder for a public webserver iis 5.x running ASP 3.0 with an Access DB on a...
1
by: Brad H McCollum | last post by:
I'm writing an application using VB 6.0 as the front-end GUI, and the MSDE version of SQL Server as the back-end (it's a program for a really small # of users --- less then 3-4). I'm trying to...
6
by: !!! Klutzo !!! | last post by:
I give permissions for ASPNET on a top level subdirectory. A windows program copies a file into the subdirectory, however, my web service cannot access the file because it does not have...
2
by: Jozef | last post by:
Hello, Is there a way to change table permissions in VB Code? I can't seem to find much that's concise in the help file. Here's the situation; I have a table in the "data" portion of a split...
7
by: none | last post by:
Hello: I had a nice php application running on my server here at home, and I uploaded it to a shared public type server and it started to break all over the place. It turns out that some...
13
by: MLH | last post by:
Invalid qualifier error displays at compile time on this A97 example from Permissions Property HELP. What's wrong with the strContainerName assignment line? (6th line) Sub...
0
by: Curt K | last post by:
We run some web services (IIS 5 and IIS 6) that communicate to a COM out of process server, which in turn communicates to another out of process COM server (long story). We have had lots of...
8
by: jporter188 | last post by:
Hello, I am working on a project to manipulate XML files. All of the files, the code, and the output are on network drives. When I run my program I get an exception (see below). I tried giving...
3
by: palepimp | last post by:
Hello all, I have searched far and wide for a solution to my issue. In short, here is the problem: 1. 3 PC's enter data into an Access 2003 database (PC's are running Vista w/ Office 2007...
6
by: DotNetNewbie | last post by:
Hello, in my web application, I have to create permissions for each user. So what I am doing is that for each role (using sqlmembership in .net) I am creating a column in the database to hold a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.