S
S
ssrdop2018-02-24 16:59:48
ubuntu
ssrdop, 2018-02-24 16:59:48

Problem with Apache user on linux and script being executed?

The folder has a makeit.php file with the contents: A group for the file and for the folder containing the given file "vagrant" and the user "vagrant" which has full write, read and execute access. When I execute on the command line: /var/www/html/makeit.php , a directory is created and everything works as it should. If I try to run this file from a browser, I get an error: "mkdir(): Permission denied .....". Prior to this, the apache user and group were changed to "vagrant" c "www-data" and restarted the server. What could be the problem - on the command line under the user "vagrant" everything works, and in the apache browser under the user and group "vagrant" it gives a write error.
mkdir(__DIR__ . "/newdir");
If anything, on the command line the command "ps aux | egrep '(apache|httpd)'" says that the user is "vagrant".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fman2, 2018-02-24
@fman2

Well, I wrote to you in VK :)
For a certain folder, you can explicitly specify the user:

config.vm.synced_folder "www", "/var/www", owner: "www-data", group: "www-data"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question