A
A
Anton2015-04-04 20:57:27
linux
Anton, 2015-04-04 20:57:27

How to write to a file if the script is running in the background from one user, and the directories belong to another?

Hello!
I run the php script with this command:

nohup php -f /path/to/file.php > /dev/null 2>&1 & echo $!

In the background hangs from the user www-data. The file.php itself is located in the directory from user1 next to the files from user1, and it itself was created by user1.
The problem is that the file_put_contents() function is not executed.
How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2015-04-04
@FanatPHP

chmod 777 user1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question