[function.unlink]: Permission denied in ...

Solution:

 

  providing you have access, you will need to CHMOD the directory to 0777.

 

Details Information:

 

bool chmod ( string $filename , int $mode )

Attempts to change the mode of the specified file to that given in mode .

Parameters

filename

Path to the file.

mode

Note that mode is not automatically assumed to be an octal value, so strings (such as "g+w") will not work properly. To ensure the expected operation, you need to prefix mode with a zero (0):

<?php
chmod
("/somedir/somefile"755);   
// decimal; probably incorrect
chmod("/somedir/somefile""u+rwx,go+rx"); 
// string; incorrect
chmod("/somedir/somefile"0755);  
// octal; correct value of mode
?>

The mode parameter consists of three octal number components specifying access restrictions for the owner, the user group in which the owner is in, and to everybody else in this order. One component can be computed by adding up the needed permissions for that target user base. Number 1 means that you grant execute rights, number 2 means that you make the file writeable, number 4 means that you make the file readable. Add up these numbers to specify needed rights. You can also read more about modes on Unix systems with 'man 1 chmod' and 'man 2 chmod'.

<?php
// Read and write for owner, nothing for everybody else
chmod("/somedir/somefile"0600
);

// Read and write for owner, read for everybody else
chmod("/somedir/somefile"0644
);

// Everything for owner, read and execute for others
chmod("/somedir/somefile"0755
);

// Everything for owner, read and execute for owner's group
chmod("/somedir/somefile"0750
);
?>

 

 

 

 

 

Description

bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )

Attempts to create the directory specified by pathname.

Parameters

pathname

The directory path.

mode

The mode is 0777 by default, which means the widest possible access. For more information on modes, read the details on the chmod() page.

Note: mode is ignored on Windows.

Note that you probably want to specify the mode as an octal number, which means it should have a leading zero. The mode is also modified by the current umask, which you can change using umask().

recursive

Default to FALSE.

context

Note: Context support was added with PHP 5.0.0. For a description of contexts, refer to Stream Functions.

 

转载于:https://www.cnblogs.com/visoeclipse/archive/2010/03/05/1679046.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值