• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question xCache setting left on PHP5.6

hexblot

New Pleskian
Hello,
supporting a server with Plesk 12.5 on Centos 7.

A number of domains ( ~100 ) are using plesk-php56-fpm, and in their pool definition ( /opt/plesk/php/5.6/etc/php-fpm.d/thedomain.tld.conf ) there is a line referring to xCache :

[....]
; Uses for log facility
; If php_value[error_log] is not defined error output will be send for nginx
catch_workers_output = yes

; php.ini custom configuration directives
php_value[date.timezone] = europe/athens
php_value[xcache.cacher] = on
php_value[open_basedir] = "/var/www/vhosts/thedomain.tld/:/tmp/"

; Following directives override default pool configuration
pm.max_children = 20​

I have identified the timezone coming for the UI (PHP "Additional Directives") from the subscription, and the open_basedir pattern is from the domain. The override in the pool configuration in the last line come from /var/www/vhosts/system/thedomain.tld/conf/php.ini

However, for the life of me, I cannot find any reference to xCache anywhere in order to disable it, and it's spamming my main log ( /var/log/plesk-php56-fpm/error.log ) with tons of the line

[12-Jan-2017 02:54:42] WARNING: [pool thedomain.tld] child 3918 said into stderr: "ERROR: Unable to set php_value 'xcache.cacher'"​

All of the domains were migrated from an older Plesk installation and defaulted to PHP5.4 which did have xCache, and then switched over to PHP5.6 if that makes any difference.

I have obviously changed / added things to the vhost php.ini, and have run /usr/local/psa/bin/php_settings -u - the generated file contains the above line.

Any ideas / leads as to where I should look next?
Thanks in advance!
 
Last edited:
Type the following command to verify XCache software on your PHP5.6:

# /opt/plesk/php/5.6/bin/php -v

If you have enabled Xcache, you should see something like

# /opt/plesk/php/5.6/bin/php -v
PHP 5.6.29 (cli) (built: Dec 9 2016 12:10:16)
Copyright (c) 1997-2016 The PHP Group
........
with XCache v3.0.1, Copyright (c) 2005-2013, by mOo
with XCache Optimizer v3.0.1, Copyright (c) 2005-2013, by mOo
with XCache Cacher v3.0.1, Copyright (c) 2005-2013, by mOo
with XCache Coverager v3.0.1, Copyright (c) 2005-2013, by mOo
........

If no - how your directive php_value[xcache.cacher] = on can be handled?
 
Hello IgorG,
no, PHP56 does not have (nor should it in my humble opinion) xCache - it comes with OPCache.
I am trying to figure out HOW the setting gets there so I can remove it (and stop the error messages), ie where that config value is actually stored and get aggregated into the pool file.

root@myserver:/ # /opt/plesk/php/5.6/bin/php -v
PHP 5.6.29 (cli) (built: Dec 9 2016 12:07:26)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
XCache IS present on PHP54 though
root@myserver:/ # /opt/plesk/php/5.4/bin/php -v
PHP 5.4.45 (cli) (built: Mar 25 2016 17:04:14)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo​

so I am giving the possibility that the domains were at some point using PHP54, got the setting, moved to PHP56 and did not lose it? I do not know.

The server also has PHP70 (which also only has OPCache). All sites are using FPM or FastCGI ( mod is not enabled ). Let me know if I can provide any other detail to help you have a clearer picture!

Again, thanks in advance!
 
XCache IS present on PHP54 though
root@myserver:/ # /opt/plesk/php/5.4/bin/php -v
PHP 5.4.45 (cli) (built: Mar 25 2016 17:04:14)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
It is because of:

[root@ppu17-0 etc]# ll /opt/plesk/php/5.4/etc/php.d/40-xcache.ini
-rw-r--r-- 1 root root 3112 Oct 6 2015 /opt/plesk/php/5.4/etc/php.d/40-xcache.ini
[root@ppu17-0 etc]# rpm -qf /opt/plesk/php/5.4/etc/php.d/40-xcache.ini
plesk-php54-xcache-3.2.0-centos7.15100614.x86_64

For php versions 5.5+ we use opcache instead of xcache.
 
The domains with the problem though all use PHP56 though -- why is this directive appearing in those pools?

root@myserver:/opt/plesk/php# grep -R xcache *
5.4/etc/php.d/40-xcache.ini: [xcache-common]
[... many other entries from the same file omitted ..]
Binary file 5.4/lib64/php/modules/xcache.so matches
5.6/etc/php-fpm.d/domainA.com.conf: php_value[xcache.cacher] = on
5.6/etc/php-fpm.d/domainB.com.conf: php_value[xcache.cacher] = on
[.. one entry per domain in the php-fpm.d dir with that line ..]
root@myserver:/opt/plesk/php#
 
Perhaps it is consequences of migration from hosting with php5.4
 
I think it's a leftover as well, where would I search to remove it though? When regenerating the pool files ( in /opt/plesk/php/5.6/etc/php-fpm.d ) it still adds the xcache line, and I am trying to figure out where it comes from in order to remove it.
 
I'd suggest you check carefully:

1. handler's php.ini
2. Service Plan, PHP Settings in Plesk UI
3. Overrride file /var/www/vhosts/system/thedomain.tld/conf/php.ini
 
Assuming handlers
- php.ini is /opt/plesk/php/5.6/etc/php.ini ( no reference to xcache )

root@myserver:/opt/plesk/php/5.6/etc# grep xcache php.ini
root@myserver:/opt/plesk/php/5.6/etc#

- service plan -> php tab -> "additional php directives" only has the "timezone = europe/athens" line (see attached )
- the per vhost php.ini only contains fpm directives ( setting pm.max_children nothing else )

root@myserver:/var/www/vhosts/system/domainA.com/conf# cat php.ini
[php-fpm-pool-settings]
pm.max_children = 20
root@myserver:/var/www/vhosts/system/domainA.com/conf#

THANK you for your assistance up to now, however the above do not have any reference to this.
Any other ideas?
 

Attachments

  • Screen Shot 2017-01-12 at 12.06.25.png
    Screen Shot 2017-01-12 at 12.06.25.png
    26.7 KB · Views: 6
Check also output of

# plesk db show PhpSettingsParameters
 
Nice one - although I cannot see which version is which, xcache params are shown numerous times :

Code:
+-----+---------------------+------------------------------+
| id  | name                | value                        |
+-----+---------------------+------------------------------+
|   1 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
|   1 | safe_mode           | off                          |
|   1 | xcache.cacher       | on                           |
|   2 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
|   2 | safe_mode           | off                          |
|   3 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
|   3 | safe_mode           | off                          |
|   3 | xcache.cacher       | on                           |
|   4 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
|   4 | safe_mode           | off                          |
|   4 | xcache.cacher       | on                           |
|  93 | max_execution_time  | 90                           |
|  93 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
|  93 | post_max_size       | 16M                          |
|  93 | safe_mode           | off                          |
|  93 | upload_max_filesize | 16M                          |
|  93 | xcache.cacher       | on                           |
| 403 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 404 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 404 | safe_mode           | off                          |
| 404 | xcache.cacher       | on                           |
| 405 | opcache.enable      | on                           |
| 405 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 405 | safe_mode           | off                          |
| 406 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 406 | safe_mode           | off                          |
| 407 | opcache.enable      | on                           |
| 407 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 407 | safe_mode           | off                          |
| 408 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 408 | safe_mode           | off                          |
| 408 | xcache.cacher       | on                           |
| 409 | opcache.enable      | on                           |
| 409 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 409 | safe_mode           | off                          |
| 410 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 410 | safe_mode           | off                          |
| 410 | xcache.cacher       | on                           |
| 412 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 412 | safe_mode           | off                          |
| 412 | short_open_tag      | on                           |
| 413 | opcache.enable      | on                           |
| 413 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 413 | safe_mode           | off                          |
| 414 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 414 | safe_mode           | off                          |
| 414 | xcache.cacher       | on                           |
| 415 | opcache.enable      | on                           |
| 415 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 415 | safe_mode           | off                          |
| 416 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 416 | safe_mode           | off                          |
| 416 | xcache.cacher       | on                           |
| 417 | opcache.enable      | on                           |
| 417 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 417 | safe_mode           | off                          |
| 418 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 418 | safe_mode           | off                          |
| 418 | xcache.cacher       | on                           |
| 419 | max_execution_time  | 90                           |
| 419 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 419 | post_max_size       | 16M                          |
| 419 | safe_mode           | off                          |
| 419 | upload_max_filesize | 16M                          |
| 420 | max_execution_time  | 90                           |
| 420 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 420 | post_max_size       | 16M                          |
| 420 | safe_mode           | off                          |
| 420 | upload_max_filesize | 16M                          |
| 420 | xcache.cacher       | on                           |
| 421 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 423 | open_basedir        | {WEBSPACEROOT}{/}{:}{TMP}{/} |
| 423 | short_open_tag      | on                           |
+-----+---------------------+------------------------------+
 
You can check existance of this record in /usr/local/psa/admin/conf/panel.ini file too.
 
Hello IgorG, and thanks for your continued efforts!

Unfortunately I do not even have that file, and no matches for xcache exist in that subtree :
Code:
root@myserver:/usr/local/psa/admin/conf# ls -lah
total 56K
drwxr-xr-x  5 root root 4.0K Jan 13 04:26 .
drwxr-xr-x 21 root root 4.0K Jun  7  2016 ..
drwxr-xr-x  2 root root 4.0K Jun  1  2016 aps
-rw-r--r--  1 root root   35 Jan 13 04:26 customizations.conf
-rw-r--r--  1 root root 2.1K Jun  6  2016 file_sharing.conf
drwxr-xr-x  2 root root 4.0K Aug 26  2015 generated
-r--------  1 root root 3.0K Jun  1  2016 httpsd.pem
-rw-r--r--  1 root root  502 Aug 26  2015 openssl.cnf
-rw-r--r--  1 root root 1.7K Aug 26  2015 panel.ini.sample
-rw-r--r--  1 root root  891 Jan 13 11:36 php.ini
-rw-r--r--  1 root root  891 Jun  1  2016 site_isolation_settings.ini
-rw-r--r--  1 root root  891 Aug 26  2015 site_isolation_settings.ini.default
-rwxr-xr-x  1 root root 1.2K Aug 26  2015 ssl-conf.sh
drwxr-xr-x  4 root root 4.0K Jun  1  2016 templates
root@myserver:/usr/local/psa/admin/conf# grep -R xcache *
root@myserver:/usr/local/psa/admin/conf#

Going up that tree though there are a few matches in /usr/local/psa/admin/externals/Zend/Cache/Backend/Xcache.php however that code is simply usage of xcache if it is loaded.
 
We are seeing this too. I happened to look in the log and found scores of domains generating the same error.

However, in our cases, you can clearly see xcache.cacher = on in
/var/www/vhosts/system/domain.tld/etc/php.ini

@hexblot - I've read all your posts but I'm not 100% sure you looked in there? You looked in conf but not in etc maybe? I'm just checking to cover all bases.

Interestingly, we are seeing the reverse in the 5.4 log (for one domain that was created on 5.6 and changed to 5.4.x):
ERROR: Unable to set php_value 'opcache.enable'

Again /var/www/vhosts/system/domain.tld/etc/php.ini has opcache.enable = on which explains why the errors are being logged.

What appears to be happening is that the appropriate configuration line is not being automatically removed from the domain's php.ini when the version is changed.

Once I have time I will experiment by creating a test domain on 5.6, checking
/var/www/vhosts/system/domain.tld/etc/php.ini then comparing with the same file after changing the PHP version to 5.4 and back again.

@hexblot if you have time maybe you could do the same to help with debugging this?
 
Last edited:
Back
Top