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 2021-02-01 18:12:57

WebGreg
Member
Registered: 2020-02-27
Posts: 740

Two errors in php-errors.log -permission and no such file or directory

Hi.

In my /var/www/html/glpi/files/_log/php-errors.log I have two events:

1. glpiphplog.WARNING:   *** PHP Warning (2): mysqli::real_connect(): (HY000/2002): No such file or directory in /var/www/html/glpi/inc/dbmysql.class.php at line 185

2. *** PHP Warning (2): error_log(/var/www/html/glpi/files/_log/cron.log): failed to open stream: Permission denied in /var/www/html/glpi/inc/toolbox.class.php at line 658



I don't know Linux (Ubuntu) and I don't know what can I do with it. Can anyone help to solve the problem please? I set:

sudo chmod -R 777

for both - inc and files folders. But the problem still exists.


--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS

Offline

#2 2021-05-21 17:20:59

support_realise
Member
Registered: 2021-04-06
Posts: 6

Re: Two errors in php-errors.log -permission and no such file or directory

Hi,

I encounter the same kind of issue, but I don't know if it's serious or not :

PHP Warning (2): error_log(/var/www/html/glpi/files/_log/cron.log): failed to open stream: Permission denied in /var/www/html/glpi/inc/toolbox.class.php at line 677

I checked the permissions (I run GLPI on a Debian box), but the toolbox.class.php file seems correct :

-rw-r--r--  1 www-data www-data 109126 Mar  2 14:22 toolbox.class.php

Thanks for your answer.

Samuel

GLPI 9.5.4
FusionInventory 9.5.0+1.0

Offline

#3 2021-05-21 21:04:25

oj69
Member
From: Somewhere in the cloud
Registered: 2021-02-01
Posts: 157

Re: Two errors in php-errors.log -permission and no such file or directory

Sounds you have a problem with the owenership of the files. Under which user the cron-job is running ? try to running the cron-job with a user-id www-data

btw: running a linux server without knowledge isn´t a good idea ...

Offline

#4 2021-05-24 13:23:42

Kaya84
Member
Registered: 2019-06-13
Posts: 217

Re: Two errors in php-errors.log -permission and no such file or directory

777 ??? ARGH! not a good idea.

BTW, on top of glpi directory (eg /var/www/glpi) do:
chown -R www-data:www-data *
(if apache is running with www-data user.. )

Offline

#5 2021-05-25 09:37:00

WebGreg
Member
Registered: 2020-02-27
Posts: 740

Re: Two errors in php-errors.log -permission and no such file or directory

oj69 wrote:

btw: running a linux server without knowledge isn´t a good idea ...

True, but sometimes there is no other option. And... somehow I have to start get this knowledge smile

oj69 wrote:

Under which user the cron-job is running

* * * * * root /usr/bin/php7.4 /var/www/html/glpi/front/cron.php &>/dev/null
0 6,9,12,16 * * * root /var/www/html/glpi/bin/console ldap:sync -u --ldap-filter=objectClass=user -q

Kaya84 wrote:

Under which user the cron-job is running
BTW, on top of glpi directory (eg /var/www/glpi) do:
chown -R www-data:www-data *

During the first installation I started with:

sudo chmod -R 755 config/ files/ marketplace/
sudo chown -R www-data:www-data files/ config/ marketplace/

But I had problems with that and that's why I switched to the 777.


Thank you all for your reply, but it has been a while and a little bit changed. Now I don't see the "failed to open stream" error. Still have "No such file or directory" but my /var/www/html/glpi/files/_log/php-errors.log is now spammed by:

[2021-05-03 08:17:48] glpiphplog.WARNING: CommonDBTM::getFromDBByCrit() in /var/www/html/glpi/inc/commondbtm.class.php line 351
getFromDBByCrit expects to get one result, 19 found!  {"user":"8@chronos"}
[2021-05-03 08:17:50] glpiphplog.WARNING: CommonDBTM::getFromDBByCrit() in /var/www/html/glpi/inc/commondbtm.class.php line 351
getFromDBByCrit expects to get one result, 1307 found!  {"user":"8@chronos"}

I have to deal with this first, and then I'll try with your advice.


--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS

Offline

#6 2021-05-25 13:44:37

Kaya84
Member
Registered: 2019-06-13
Posts: 217

Re: Two errors in php-errors.log -permission and no such file or directory

Try to disable fusioninventory plugin.
Seems related: https://nmb48.top/fusioninventory/fusio … ssues/3159

Offline

#7 2021-06-10 18:09:55

support_realise
Member
Registered: 2021-04-06
Posts: 6

Re: Two errors in php-errors.log -permission and no such file or directory

Hello !

oj69 wrote:

Sounds you have a problem with the owenership of the files. Under which user the cron-job is running ? try to running the cron-job with a user-id www-data

Indeed, my cronjob was executed by root and not www-data. I changed my cronjob and I'll check the logs tomorrow. Some of my logs were owned by root and not www-data, therefore I changed the ownership as well (chown -R www-data:www-data).

Best regards,

Samuel

Offline

#8 2023-08-26 23:53:16

Saadh.eisa
Member
Registered: 2023-08-01
Posts: 2

Re: Two errors in php-errors.log -permission and no such file or directory

Just for Reference

I had the same issue, after investigations the selinux was the reason.

Offline

Board footer

Powered by FluxBB