I have a problem with my Apache user. He seems to have no right on linux system.
I use CentOS 7, Apache 2.4.6, PHP 5.5.21. The apache user is apache:apache
When I try to use chmod()
or fopen()
I get "Permission denied"
So I have created a file named info.php :
-rwxrwxrwx. 1 apache apache 50 Jan 30 13:55 info.php
In this file I just added this line :
<?php chmod("info.php", 777); ?>
And the result is :
Warning: chmod(): Permission denied in /var/www/html/info.php on line 1
So I think that the probelm is, system user Apache has no rights but I don't know how can I fix tis?
Thanks.
EDIT : fix php code