You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-10-22 09:25:49

verus
Member
Registered: 2007-06-07
Posts: 60

php-errors.log changes ownership automatically

Hi,

The file php-errors.log has apache.apache as owner but it changes automatically to root.root.
When that happens, I can't access glpi anymore.
How can I prevent that from happening?
Thanks. V.

Offline

#2 2020-10-26 10:50:37

verus
Member
Registered: 2007-06-07
Posts: 60

Re: php-errors.log changes ownership automatically

Great support here...

Offline

#3 2020-10-26 21:23:57

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: php-errors.log changes ownership automatically

Do you have a cron task for GLPI running as root instead of Apache?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#4 2020-11-23 12:00:32

verus
Member
Registered: 2007-06-07
Posts: 60

Re: php-errors.log changes ownership automatically

The cron task is executed as root, when I run it as apache it is not working:

root /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null
This works

This doesn't work:
apache /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null

Thanks.

Last edited by verus (2020-11-23 12:25:53)

Offline

#5 2020-11-23 20:09:26

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: php-errors.log changes ownership automatically

Are you able to manually run the command as Apache? Do any errors show up in files/_log/cron.log or files/_log/php-errors.log? You will need to make sure the ownership on those log files is correct first before running the command.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#6 2020-11-23 20:50:54

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: php-errors.log changes ownership automatically

verus wrote:

The cron task is executed as root, when I run it as apache it is not working:

Assuming the path below, provided by you, is the actual path for the installation, proceed as follows.

As root do:

chgrp -R apache /var/www/html/glpi/files/_log
chmod g+ws /var/www/html/glpi/files/_log
chmod g+w /var/www/html/glpi/files/_log/*

Change the Cron Job back to

verus wrote:

apache /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null

I hope this helps you fix the issue you're facing.

Offline

#7 2023-02-23 12:10:56

doesntMatter
Member
Registered: 2016-07-06
Posts: 108

Re: php-errors.log changes ownership automatically

I have the same problem - but the cron is running as www-data. Ideas?

Offline

#8 2023-03-09 10:56:42

doesntMatter
Member
Registered: 2016-07-06
Posts: 108

Re: php-errors.log changes ownership automatically

bump

Offline

Board footer

Powered by FluxBB