alt-php error log location question

leonep

Well-Known Member
Nov 18, 2014
163
8
68
Pescara
cPanel Access Level
Root Administrator
Hi,
i want to know if is possible to bind error log location for alt-php using parameters like multiphp

in the yaml file of multiphp i can set like this:
php_admin_value_error_log: "[% homedir %]/logs/[% scrubbed_domain %].php.error.log"

so all errors are always stored in the same location. very useful and ordered

the question is : there is a way to accomplish this on alt-php?

thanks
 

leonep

Well-Known Member
Nov 18, 2014
163
8
68
Pescara
cPanel Access Level
Root Administrator
i try to use wildcard and it not work on phpinfo page i have:

error_log = [% homedir %]/logs/[% scrubbed_domain %].php.error.log

if not transform to;
error_log = user/logs/domain.tld/php.error.log

any other ways ?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,908
607
273
cPanel Access Level
Root Administrator
If that isn't performing how you expect it might be a good idea to contact CloudLinux directly to see if they have thoughts on this. If your license for CloudLinux is purchased through cPanel, you can also submit a ticket to our team directly and we can look into this more.
 

leonep

Well-Known Member
Nov 18, 2014
163
8
68
Pescara
cPanel Access Level
Root Administrator
CLOUDLINUX SUPPORT:


Unfortunately, the alt-PHP doesn't have the cPanel PHP-FPM integration with the YAML file, as described here:
https://docs.cpanel.net/knowledge-base/php-fpm/configuration-values-of-php-fpm/

Thus we can't use templates like:

"[% homedir %]/logs/[% scrubbed_domain %].php.error.log"

in the alt-PHP configuration files or as a PHP directive due to the PHP configuration file limitations.

And since the PHP directives don't support custom variables - you can't set the variables like:
error_log = ~/error_log
error_log = /~/error_log
error_log = $HOME/error_log
error_log = /$HOME/error_log

This information can be obtained also from the php.ini configuration notes:
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT

Also, the PHP error_log directive doesn't support custom variables: https://www.php.net/manual/en/function.error-log.php

Thus the only option that I can suggest - setting the custom error_log location per-user configuration:
https://docs.cloudlinux.com/cloudli...itional-php-ini-file-for-a-user-inside-cagefs
https://docs.cloudlinux.com/cloudli...al-customer-on-cpanel-server-with-easyapache4

Or you can allow users to manage the error_log value in the PHP Selector interface to determine the log location:
https://docs.cloudlinux.com/cloudlinux_os_components/#custom-php-ini-options
 
  • Like
Reactions: cPRex
Thread starter Similar threads Forum Replies Date
G Product Extensions 1