473,322 Members | 1,522 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,322 software developers and data experts.

permissions problem with unlink()

I am having trouble getting unlink() to work on my local machine
(win 2000, Apache, php 4.2.2)

when I invoke unlink() in order to change a file name during
a 'picture edit' change from a form upload on my local machine using simple
stuff like:

<?php

if(file_exists($new_file_name)){

unlink($new_file_name);
}

if($new_pic){rename($old_file_name,$new_file_name) ;}

}

?>

I get:

Warning: unlink() failed (Permission denied) in
C:\FoxServ\www\content\do_page_content.php on line 161

this doesn't happen with my online set-up so I am pretty sure it's a
permissions issue (and the error message says so!)

I have looked at and checked the permissions on all the relevant folders via
win 2000 settings, allowing full read/write to 'everyone' etc.
but it makes no difference. Maybe I'm not setting them correctly? help
appreciated.
Jul 17 '05 #1
1 2765
oops, sorted this out - I had a problem with naming the file
earlier in the script which when sorted didn't create this problem.
classic example of taking an error message too literally and looking in the
wrong place.

"Chamomile" <ne********@chamomile.co.uk> wrote in message
news:41********@dnews0.news.legend.net.uk...
I am having trouble getting unlink() to work on my local machine
(win 2000, Apache, php 4.2.2)

when I invoke unlink() in order to change a file name during
a 'picture edit' change from a form upload on my local machine using simple stuff like:

<?php

if(file_exists($new_file_name)){

unlink($new_file_name);
}

if($new_pic){rename($old_file_name,$new_file_name) ;}

}

?>

I get:

Warning: unlink() failed (Permission denied) in
C:\FoxServ\www\content\do_page_content.php on line 161

this doesn't happen with my online set-up so I am pretty sure it's a
permissions issue (and the error message says so!)

I have looked at and checked the permissions on all the relevant folders via win 2000 settings, allowing full read/write to 'everyone' etc.
but it makes no difference. Maybe I'm not setting them correctly? help
appreciated.

Jul 17 '05 #2

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

Similar topics

1
by: sean | last post by:
hi Firstly i am working with php in an enviroment that supports unix-like permission in an accademic environment. The problem is enabling my script to upload a image file to my home folder,...
3
by: lawrence | last post by:
I've two scripts, one to upload images, another to delete them. The upload script works fine, but the delete script has permissions trouble. How can PHP not have permission to delete an image it...
1
by: Alexandru | last post by:
Hello fellows. i have a problem with unlink function. if i'm trying to use uplink like this: unlink("../home/meks_party.jpg"); i got the message: Warning: unlink(../home/meks_party.jpg): No...
5
by: Phil Powell | last post by:
print_r(is_file("$logPath/$logFileName")); // RETURNS 1 unlink("$logPath/$logFileName"); // RETURNS WARNING: PERMISSION DENIED This code should tell me that the file located at...
13
by: Arno R | last post by:
Hi all, I am deploying an A2k app to users with different versions of Access. Using Access 2000 the relinking on startup (on deploying a new frontend or when backend has changed) is very fast....
4
by: nitinpatel1117 | last post by:
Hi I am trying to delete a csv file using the unlink() function, but i keep getting a permission denied warning Warning: unlink(UsedNOS200704191.CSV): Permission denied in...
2
banning
by: banning | last post by:
while($row = mysql_fetch_array($getID)){ $id=$row; $dir='../picture_library/floorplans/'.$id; mkdir($dir,0777); chmod($dir,0777); } ok this is really starting to kill me... i've...
1
by: fcaserio | last post by:
Is there any PHP.INI config or windows permission (win 2003) that can prevent PHP to unlink files with the system path? unlink works with relative path: @unlink("temp\0000058.txt") but it is...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.