Welcome Guest, Not a member yet? Register   Sign In
function unlink()
#1

Hello, I can’t understand why the file is not deleted. The file path is correct. I try to delete the file from the controller with the unlink() function. The file is located behind the project on the current server.

engine/inc/myproject - here is the framework
engine/my_files - there are files that I'm trying to delete through the unlink() function

There are no errors!

PHP Code:
unlink($_SERVER['DOCUMENT_ROOT'] . "engine/my_files/file.tmp"); 
the file does not delete!

PHP Code:
unlink($_SERVER['DOCUMENT_ROOT'] . "engine/my_files/file.text"); 
file deletes!
Reply
#2

Is the file read only etc; check the file chmod settings.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Undoubtedly a matter of permissions.
Reply
#4

(This post was last modified: 02-25-2020, 10:13 AM by dimalebid.)

I tried not to remove it from the controller. Is deleted! I threw the php file to the root and tried to delete the file there. everything worked and the file was deleted. If deleted from the controller, the file is not deleted.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB