473,411 Members | 2,013 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,411 software developers and data experts.

directory permissions

How does one set directory permissions in PHP? The manual only refers
to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

John

Nov 21 '06 #1
9 5142
On 21 Nov 2006 11:37:08 -0800, jo******@fastermail.com wrote:
>How does one set directory permissions in PHP? The manual only refers
to chmod function changing permissions for files. I try to use it for
directories but it didn't work.
In what way did it not work? Because that's the correct function to use.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 21 '06 #2

Andy Hassall wrote:
On 21 Nov 2006 11:37:08 -0800, jo******@fastermail.com wrote:
How does one set directory permissions in PHP? The manual only refers
to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

In what way did it not work? Because that's the correct function to use.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Here is the statement I am running
chmod(./directoryname/, 0777)

Nov 22 '06 #3
jk*****@gmail.com wrote:
Andy Hassall wrote:
On 21 Nov 2006 11:37:08 -0800, jo******@fastermail.com wrote:
How does one set directory permissions in PHP? The manual only
refers to chmod function changing permissions for files. I try to
use it for directories but it didn't work.
In what way did it not work? Because that's the correct function
to use.

Here is the statement I am running
chmod(./directoryname/, 0777)
You ARE enclosing the directory path in quotes, right?

chmod("./directoryname/", 0777);

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Nov 22 '06 #4
Yes, I am enclosing the directoryname with quotes

John

Kim André Akerĝ wrote:
jk*****@gmail.com wrote:
Andy Hassall wrote:
On 21 Nov 2006 11:37:08 -0800, jo******@fastermail.com wrote:
>
How does one set directory permissions in PHP? The manual only
refers to chmod function changing permissions for files. I try to
use it for directories but it didn't work.
>
In what way did it not work? Because that's the correct function
to use.
Here is the statement I am running
chmod(./directoryname/, 0777)

You ARE enclosing the directory path in quotes, right?

chmod("./directoryname/", 0777);

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Nov 22 '06 #5
>How does one set directory permissions in PHP? The manual only refers
>to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

In what way did it not work? Because that's the correct function to use.
>Here is the statement I am running
chmod(./directoryname/, 0777)
What is the owner of the directory?
What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

If these don't match, you can't change the permissions because the OS
won't let PHP do it.
Nov 22 '06 #6

Gordon Burditt wrote:
How does one set directory permissions in PHP? The manual only refers
to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

In what way did it not work? Because that's the correct function to use.
Here is the statement I am running
chmod(./directoryname/, 0777)

What is the owner of the directory?
What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

If these don't match, you can't change the permissions because the OS
won't let PHP do it.
The directory is under apache web root directory. Its currently set to
755. I am running PHP under apache.

Nov 23 '06 #7

Gordon Burditt wrote:
How does one set directory permissions in PHP? The manual only refers
to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

In what way did it not work? Because that's the correct function to use.
Here is the statement I am running
chmod(./directoryname/, 0777)

What is the owner of the directory?
What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

If these don't match, you can't change the permissions because the OS
won't let PHP do it.
The directory is under apache web root directory. Its currently set to
755. I am running PHP under apache.

Nov 23 '06 #8
jo******@fastermail.com wrote:
Gordon Burditt wrote:
>>>>>How does one set directory permissions in PHP? The manual only refers
>to chmod function changing permissions for files. I try to use it for
>directories but it didn't work.

In what way did it not work? Because that's the correct function to use.
>>>Here is the statement I am running
chmod(./directoryname/, 0777)

What is the owner of the directory?
What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

If these don't match, you can't change the permissions because the OS
won't let PHP do it.


The directory is under apache web root directory. Its currently set to
755. I am running PHP under apache.
But again, who is the owner? And what is the user Apache is running under?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 23 '06 #9
>How does one set directory permissions in PHP? The manual only refers
>to chmod function changing permissions for files. I try to use it for
directories but it didn't work.

In what way did it not work? Because that's the correct function to use.
>Here is the statement I am running
chmod(./directoryname/, 0777)

What is the owner of the directory?
What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?

If these don't match, you can't change the permissions because the OS
won't let PHP do it.

The directory is under apache web root directory.
AND WHAT USER OWNS IT? (Hint: under UNIX, "ls -ld" will tell you this.
Under PHP, the stat() or fileowner() function will give the numeric user id,
and the posix_getpwnam() function will translate that to a name.)
>Its currently set to
755. I am running PHP under apache.
AS WHAT USER?
(Hint: under UNIX, various forms of ps will give the user name running
the 'httpd' or 'apache' process. )

Nov 23 '06 #10

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

Similar topics

2
by: bonehead | last post by:
Many thanks to all who replied to my previous post regaring proper installation of phpMyAdmin on unix/apache. Okay, I thought I had correctly followed all the steps to password-secure the...
0
by: Tracy Tripp | last post by:
I'm working on a program that takes files by path and moves them into new locations, and then back again if the user intends. Everything is great so far except I cannot figure out how to keep...
4
by: Steven | last post by:
Does anyone know if there is a way to check the access permissions of different users using C#? I need to know if a user has full control or if they have read only access or none to a certain...
0
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated ...
3
by: James Coleman | last post by:
Hello, The following error is appearing when attempting to create a directory using the availale system.io methods: System.IO.DirectoryNotFoundException: Could not find a part of the path...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
2
by: BLetts | last post by:
I have an ASP.NET app that must allow users to upload files. The files are stored in a virtual directory. I use Server.MapPath to map from the virtual directory name to a physical path, then the...
8
by: theWizard1 | last post by:
Using Asp.NET 1.1, and C#. I have a directory for the website, and a directory under it named Secure. I have a web.config in each of the above directories. The web.config in the Secure...
1
by: Aek | last post by:
What is the best way to recursively change the permissions of the directory we are installing into? Is there a nice way to do this in C# ..NET? We are using an MSI installer and will need to add...
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.