473,761 Members | 2,410 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 2799
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
2262
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 photoFinalDestination from within unix
3
3208
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
2906
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
6474
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
4519
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 Access 2000. Now It takes about 1,5 to 2 minutes !! to relink the same 50 tables. I am testing...
4
12831
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 script. The data in the attachements is then read and stored into MySQL. Once i've finished reading...
2
1460
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 (not sure if that will have any bearing).
1
2498
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 directories, so I use absolute path to make sure the path is correct. I've installed my application on...
5
13379
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 website URL before the image URL.
0
9336
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5215
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3866
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.