Jump to content

php cannot wirte to external usb hard drive?


shams

Recommended Posts

In ubuntu 18.10 ,  i created a folder name db in the external usb hard dirve changed the ownership to the www-data the apache2 server and set the permissions to 777 , i run this php code and get the permission error:

<php
 chdir('/media/user/e46cafba-2656-4e42-b1c9-6417f28839df/db/');
 system('./rs');
?>    

but the php code cannot change to the dir and get the error:

[21-Feb-2019 10:43:26 UTC] PHP Warning:  chdir(): Permission denied (errno 13) in /home/user/www/html/rse4db.php on line 5

 

Link to comment
Share on other sites

First using 777 is very dangerous so you really don't want those permissions. Second, just because the directory 'db' has those permissions, it does not mean the upper level directories have the correct ownership or permissions. You have to look at each level.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.