0

On my Nginx server in /var/log there is php5-fpm.log and php_error.log The php_error.log has all kind of notices so that it's size grows to hundreds of Mb's. I tried to find which php.ini managed this file, but no luck.

php --ini

gives:

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      
/etc/php5/cli/conf.d/05-opcache.ini,
/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-apcu.ini,
/etc/php5/cli/conf.d/20-curl.ini,
/etc/php5/cli/conf.d/20-gd.ini,
/etc/php5/cli/conf.d/20-geoip.ini,
/etc/php5/cli/conf.d/20-horde_lz4.ini,
/etc/php5/cli/conf.d/20-intl.ini,
/etc/php5/cli/conf.d/20-json.ini,
/etc/php5/cli/conf.d/20-ldap.ini,
/etc/php5/cli/conf.d/20-mcrypt.ini,
/etc/php5/cli/conf.d/20-memcache.ini,
/etc/php5/cli/conf.d/20-mongo.ini,
/etc/php5/cli/conf.d/20-mysql.ini,
/etc/php5/cli/conf.d/20-mysqli.ini,
/etc/php5/cli/conf.d/20-pdo_mysql.ini,
/etc/php5/cli/conf.d/20-pdo_sqlite.ini,
/etc/php5/cli/conf.d/20-pspell.ini,
/etc/php5/cli/conf.d/20-readline.ini,
/etc/php5/cli/conf.d/20-sasl.ini,
/etc/php5/cli/conf.d/20-sqlite3.ini,
/etc/php5/cli/conf.d/20-tidy.ini,
/etc/php5/cli/conf.d/20-xdebug.ini,
/etc/php5/cli/conf.d/20-xmlrpc.ini

The /etc/php5/cli/php.ini is set to

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

From the browser, phpinfo(); says that /etc/php5/fpm/php.ini is used, this is also set to error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

After setting this values I did a sudo service php5-fpm restart

Still all kind of notices and stack traces, Any idea where this logfile comes from?

C.A. Vuyk
  • 612
  • 10
  • 17
  • 1
    Check the notices and see what scripts are issuing them. Then look what kind of PHP process is running those scripts and what configs is it using. – Florin Asăvoaie Aug 30 '16 at 10:03
  • https://serverfault.com/questions/320716/find-out-which-process-is-changing-a-file/320718#320718 – user9517 Aug 30 '16 at 10:53

1 Answers1

1

Hi you first need to check which php-fpm.conf file the php-fpm service is using.

sudo ps -aux | grep "php-fpm"

It will show the configuration file it is using.

Go to that path. e.g. /etc/php5/fpm and edit php-fpm.conf to disable logging.

Inside /etc/php5/fpm/www there is another .conf file disable logging on that too.

dkakoti
  • 181
  • 1
  • 4
  • Hi, ps -aux | grep "php-fpm" gives: root 3788 0.0 0.0 11740 936 pts/0 S+ 13:01 0:00 grep --color=auto php-fpm www-data 5858 0.0 9.2 480084 94112 ? S Aug26 2:49 php-fpm: pool www www-data 11182 0.0 8.2 475236 84044 ? S Aug26 2:28 php-fpm: pool www www-data 29016 0.0 5.9 465972 60104 ? S Aug29 0:51 php-fpm: pool www No path is shown? – C.A. Vuyk Aug 30 '16 at 11:04
  • It will show like this `root 18889 0.0 0.4 254312 18360 ? Ss Aug11 4:18 php-fpm: master process (/etc/php/5.6/fpm/php-fpm.conf)`. Check for the master fpm process. – dkakoti Aug 30 '16 at 11:06
  • Try `sudo ps -aux | grep "fpm"` – dkakoti Aug 30 '16 at 11:07
  • Again the output is like in above comment, so after php-fpm: pool www – C.A. Vuyk Aug 30 '16 at 11:11
  • Sometimes it uses fpm configuration from /etc/php/ you can see different version of php exists. Or it can be /etc/php5/fpm/php-fpm.conf and pool.d/www.conf file , where you can disable and comment the logging. – dkakoti Aug 30 '16 at 11:16