473,543 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_fil e_name);
}

if($new_pic){re name($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 2785
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********@cha momile.co.uk> wrote in message
news:41******** @dnews0.news.le gend.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_fil e_name);
}

if($new_pic){re name($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
2253
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, called say photoFinalDestination. so far i have set up my groups to 'www' with read, write and execute permissions on the folder...
3
3188
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 itself uploaded? Here is the delete script I'm using right now, and the error messages I got below.
1
2893
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 such file or directory in /home/alphadyn/public_html/wakeboarding/manage/doAction.php on line 24 where could be the problem?
5
6454
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 $logPath/$logFileName should delete the log file, however, it never deletes it due to permissions error. However, upon checking the file properties I find this:
13
4493
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. It takes about 4-5 seconds to relink some 50 tables. (I am relinking, not refreshing) Using Access 2003 the relinking is very slow compared with...
4
12813
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 E:\webroot\dev\file_test\index.php on line 416 My script basically reads email attachments and downloads the attachment file into the current directory of the running...
2
1448
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 bee on this for an hour now surfing the net trying to find a solution. I am using a test server that i run on my computer to build sites and then upload...
1
2484
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 not workinng with the absolute path @unlink("C:\htdocs\temp\0000058.txt") the thing is I use unlink within a function called from different...
5
13314
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 http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the...
0
7408
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7590
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7735
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7688
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5885
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4895
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.