S
S
Screamin-Jay2014-08-07 11:18:55
linux
Screamin-Jay, 2014-08-07 11:18:55

Where and what rights must be set to write to the local server?

I perform some functions in php, but the wrong permissions are set that do not allow recording.

move_uploaded_file($_FILES["filename"]["tmp_name"], "/var/www/image ".$_FILES["filename"]["name"]);

A file with "read-only" rights is created at the root of the local server, as I understand it, a temporary file. But nevertheless, nothing is written to /var/www/image.
mkdir ("/var/www/imagenew", 0777);
A read-only folder is created, without the possibility of writing files there, without specifying 0777, the same thing.
I think the problem is in the wrong setting of linux / apache rights

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ergil Osin, 2014-08-07
@Ernillew

See what user apache is running under and who owns the directory you are trying to write to. Don't use 777 on directories, use 750 or even 700.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question