Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chmod() problem

Status
Not open for further replies.

KolNedra

Programmer
Oct 5, 2001
5
NL
I've created a small webboard so members could post things on that board, the script works fine, only I have chmod() problem:

The txt file I write the board to isin this directory: "
and I created a small php script that looks like this:

<?php
chmod(&quot;board1.txt&quot;, 0666);
?>

and place the script in &quot;now I loaded that script and this error popped up:

&quot;Warning: chmod failed: Operation not permitted in /web/sites/65/kolnedra/ on line 9&quot;

The ISP also gave me this information:

Your full directory path for use in cgi/php scripts is:
/web/sites/65/kolnedra/
Could someone please help me!
 
Hi Kol,
Even though your user_id is able to chmod the file, it doesn't mean the php script can do it aswell. You need to find out what user_id the script is running under.
the php script will run under the user_id of the web server (most of the time) . Thus you have to make sure your
webserver user_id has write permission for the file.


cheers

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top