How to Fix Unlink Permissions in PHP
Using the unlink() function while running a PHP script allows you to delete specific files from your Web server. Unfortunately, when attempting to delete a file by using the unlink() function, a PHP script can sometimes return an error message due to misconfigured file permissions. You can fix that issue to allow the script to delete files by following a specific procedure.
Instructions
-
-
1
Launch the file transfer protocol program that you normally use to manage your website. Connect to your Web host by using your account name and password, as well as the FTP address that was sent to you upon purchasing your hosting package.
-
2
Navigate to the folder that contains the directory holding the files you want the PHP script to delete.
-
-
3
Right-click on the directory that contains the file and select "Set attributes" or "File permissions."
-
4
Enter "755" in the field and click on "OK" or "Save." A 755 permission code instructs the operating system to allow scripts to create, modify and delete files.
-
5
Disconnect from the server and quit the FTP application.
-
1