S
S
Stanislav Pochepko2015-06-18 09:32:08
PHP
Stanislav Pochepko, 2015-06-18 09:32:08

Why does mkdir create lockable folders and files on the server (UBUNTU)?

Good afternoon. Tell me why when executing this line of code in the image manager for OpenCart

mkdir($directory . '/' . str_replace('../', '', $this->request->post['name']), 0777);

folders and files with a lock are created in the image folder.
Then, when attaching them to the product, they do not allow loading the product editing page

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Agafonov, 2015-06-18
@Tairesh

The padlock icon means that the file or folder is owned by another user. I looked into the crystal ball and it says that PHP is working for you from the www-data user, files are created on his behalf.
The simplest solution is to add your user to the www-data group and the www-data user to your group.
And yes, it is very harsh to transfer data from a POST request directly to mkdir.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question