• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

plesk-php56-fpm Error log is huge

BizMarquee

Basic Pleskian
The error log and it's archives are very huge in /var/log/plesk-php56-fpm

I haven't examined them, I just delete them because my server and its websites are not problematic. Should I be examining them? Or, how can I adjust their rotation?
 
logrotation can be configured in /etc/logrotate and the .conf files in /etc/logrotate.d. For example you could change the "weekly" in /etc/logrotate to "daily". And yes, you should examine the content of huge log files, because huge error logs indicate problems.
 
logrotation can be configured in /etc/logrotate and the .conf files in /etc/logrotate.d. For example you could change the "weekly" in /etc/logrotate to "daily". And yes, you should examine the content of huge log files, because huge error logs indicate problems.


Hi,

i have the same issue and your answer doesn't make any sense in a shared hosting environment

in multiple situations, with this setup, logrotate is cannot help the problem

if you have 300 clients flooding the same log file, logrotate cannot help it

and its not my job to manage all single php errors from all shared hosting clients on all servers i manage so is it possible to split the logging per domain and inside their hosting path, by default, so the used space by the logging is calculated in their hosting plan instead of /var/log


Thank you.
 
@Nerigal

I have to make a distinction between two parts in your post.

The first statement is

i have the same issue and your answer doesn't make any sense in a shared hosting environment

in multiple situations, with this setup, logrotate is cannot help the problem

if you have 300 clients flooding the same log file, logrotate cannot help it

and I must say that logrotate actually will help, but only in the sense that the amount and size of logs is reduced.

In essence, that is part of the solution to your problem........... but NOT the full solution.

The second statement is

and its not my job to manage all single php errors from all shared hosting clients on all servers i manage so is it possible to split the logging per domain and inside their hosting path, by default, so the used space by the logging is calculated in their hosting plan instead of /var/log

and I must say that it certainly is NOT recommended to put log entries, normally placed in /var/log, in domain related directories that are to a high degree accessible.

In essence, it might be possible, but why sharing information about the state and setup of your server? Your clients will not value it and/or get the wrong impression, whilst the average hacker is enjoying the information about errors, which are essentially weaknesses in your server eco-environment.

Simply stated, specific information is only for the eyes of the sysadmin.

Let us return to a more sane approache and tackle the root cause of the problem: usage of PHP 5.6 or any other outdated PHP version.

The quintessence of the log entries is "error" and "warning" entries, as a result of a very outdated PHP version, which is not supported by the code on the server.

If you are using outdated PHP version on your server, you are certain to get huge PHP related log files, with lots of errors and warnings.

In conclusion, the simple solution would be updating to more recent PHP versions, preferably PHP 7.2.x (and sometimes, PHP 7.1.x is more backwards compatible).

If updating is not an option, then it certainly is NOT an option to maintain PHP 5.6 based applications in any hosting environment and certainly NOT a shared hosting environment, since PHP 5.6 is very vulnerable from the perspective of security (!) .

Hope the above helps a bit.....

Regards........
 
and I must say that it certainly is NOT recommended to put log entries, normally placed in /var/log, in domain related directories that are to a high degree accessible.

In essence, it might be possible, but why sharing information about the state and setup of your server? Your clients will not value it and/or get the wrong impression, whilst the average hacker is enjoying the information about errors, which are essentially weaknesses in your server eco-environment.

Simply stated, specific information is only for the eyes of the sysadmin.

First, Plesk use to log php error separately in each user log folder /var/www/vhost/<domain>/logs/error_log by default since i work with Plesk so this not arcane magic
and in fact its always been like that in all CP i ever used

Second, saying that php error/warning logs are critical informations and should stay in /var/log is questionable.

In fact, if an hacker is at the point where he can have access to logs files in a hosting plan, you have a much bigger problem to worry about.

Let us return to a more sane approache and tackle the root cause of the problem: usage of PHP 5.6 or any other outdated PHP version.

The quintessence of the log entries is "error" and "warning" entries, as a result of a very outdated PHP version, which is not supported by the code on the server.

If you are using outdated PHP version on your server, you are certain to get huge PHP related log files, with lots of errors and warnings.

In conclusion, the simple solution would be updating to more recent PHP versions, preferably PHP 7.2.x (and sometimes, PHP 7.1.x is more backwards compatible).

If updating is not an option, then it certainly is NOT an option to maintain PHP 5.6 based applications in any hosting environment and certainly NOT a shared hosting environment, since PHP 5.6 is very vulnerable from the perspective of security (!) .

of course, but once again, This statement is unrealistic
I cannot force my customers to spend money on programmers to upgrade their web platform to make it compatible to a more recent php version.

If i would make business that way, i wouldn't have any customers.

So at the end, im not here to start a debate... for my requirement, i need my client to have php error logs in their hosting folder path /var/www/vhost/<domain>/logs/<whatever_php_error_log_file_name>
How can i do it with plesk.

Thank you
 
@Nerigal if you change the web site to run PHP as FastCGI instead of PHP-FPM I suspect it will work. I believe there is a common log because the PHP-FPM process is shared so it is has only one log file. On our older PPA platform FastCGI logs in each vhost directory.
 
its a pool per user basis
so logs should be on the respective user log folder to prevent system log flooding
in fact, This default configuration could be a potential a security problem as it could potentially flood your /var/log partition
if you don't have a good layout and /var/log is / ... oooh god.

maybe this can help fixing the problem with the default setup



Code:
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; include=/opt/plesk/php/5.6/etc/php-fpm.d/*.conf

Code:
php_admin_value[error_log] = /vhosts/example.com/logs/php_error.log
 
Last edited:
Back
Top