If you have problem using PHP unlink() function in CodeIgniter, I have a solution to it.
Below is the error you would most likely encounter:
A PHP Error was encountered
Severity: Warning
Message: unlink() [function.unlink]: http does not allow unlinking
Apparently, it seem that we can’t delete the file directly with absolute path in CodeIgniter. (Example of absolute path is http//:….)
So in order to resolve this, we have to do the following:
1 |
|
As you can see, unlinking the file using relative path works pretty fine and well.
转载于:https://blog.51cto.com/why123/228626