• 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 How to safely update mysql "Client API header version"

sjerp van wouden

New Pleskian
Tip to everyone: Plesk itself uses mysql. Dont fool around if you're not sure what you're doing! You might mess up your installation.

EDIT 7 june 2017: Do not follow up with code posted below here! If I find out the proper way I will post it! just messed up my server!

...which is the reason I'm starting this topic. I expect more people to have this issue so this should be a question & description. It's verbose so it's findable.

I thought I had taken all proscribed steps for updating mariaDB.
For some reason I've got this warning popping up:
mysql_connect(): Headers and client library minor version mismatch

You can check your versions by filtering "Client API" from the php info.
php -i | grep "Client API"
which gives me
Client API version => 10.1.23-MariaDB
Client API library version => 10.1.23-MariaDB
Client API header version => 5.5.50-MariaDB

So I suspect I forgot one step.

Your server can run without trouble with this warning, in other cases not. Best to solve it. For example, connecting Wordpress Jetpack will not working while this issue remains: you'll get a 520 error and a weird print "client_secret".

So: how to safely update this version?

BTW I'm on Centos 7
 
Last edited:
So: how to safely update this version?

BTW I'm on Centos 7
I think that you need to upgrade php-mysql package. For example, when I disable mysqli module in /etc/php.d/mysqli.ini file I see:

# php -i | grep "Client API"
Client API version => 5.5.52-MariaDB
Client API version => 5.5.52-MariaDB

And:

# rpm -qf /usr/lib64/php/modules/mysqli.so
php-mysql-5.4.16-42.el7.x86_64
 
Hi Igor,

thanks for your answer.
Indeed I need to update the php-mysql package.
In this rather old thread upgrade php package it is said that "It will drop right into Plesk" after you update the php-mysql package. There are in fact many topics on this issue so I'm happy you didn't tell me to go read somewhere else :) But this 'it will fix itself' exactly what I'm worried about. I'll look into your suggestion and report back what I find.
 
Ok so for the nooblars like me.....I'll (try to) write down that Igor means by that.

1) disable the mysqli module by commenting out. See this thread. Put a semicolon before "extension...".
2) Client API versions mentioned on php -i grep "Client API", but no more library or header versions mentioned. Two lines instead of four. (I posted three above)
3) The rpm command with q and f options. q is for querying packages and f is for file. So I'm looking into the version of that module. Which is php-mysql-5.4.16.42.el7.x86_64

So far so good - only reading. Indeed, we need to update. But how to do this safely?
Some thing that could go wrong, I suppose, is that after I update the php-mysql package plesk keeps a reference to a no longer existing older package.
Which sort of brings me back to my original question :p
 
Hi sjerp van wouden,

Indeed, we need to update. But how to do this safely?
The additional package "php-mysql-5.4.16.42.el7.x86_64" depends on your installed PHP version and is compiled exactly for this PHP version and it's configured dependencies ( => libmysqlclient18 ). ;)

If you desire to get rid of your WARNING ( not an error, pls. note that! ), pls. consider to replace the extension with the "php-mysqlnd" version, which doesn't link to any libmysqlclient library. ;)
 
( not an error, pls. note that! )
Indeed it is not an error :) As I said, the server can keep rolling along just fine but in some cases the warning will cause trouble, such as connecting WP Jetpack.

So onto the next step: then replacing with mysqlnd .
In a previous attempt at Plesk, this is exactly where it went wrong. I messed up plesk in the process of starting using mysqlnd.
Idiots summary of mysqlnd: it's a one size fits all php-mysql package so it solves conflicts.
It's said that mysqlnd is shipped with Plesk.
There's no documentation on mysqlnd at Plesk.
I think I did not phrase my question clear enough. I saw how to enable mysqlnd for php? before. I didn't want to follow these steps because I wasn't sure whether this was safe. Again the reason for this worrying is that plesk itself depends on mysql.

So is this the safe way to start using mysqlnd in plesk?

you can
yum remove php-mysql


before
yum install php-mysqlnd


Then check for success via
php -m | grep mysqlnd

Before using yum, I like to check relevant installs, in this case like so: yum list installed | grep sql tells me (again) about php-mysql.x86_64.
But there's also plesk-php[56,70,71]-mysql.x86_64. So that's one of those things that cause my concern.

Do I need to tell plesk about this php-mysql -> php-mysqlnd transition?

BTW, maybe it would be nice to have a page on mysqlnd in the documentation.
 
Last edited:
Hi sjerp van wouden,

pls. don't mix ( additional! ) Plesk PHP versions ( and its extensions/modules ) , with your vendor PHP version ( and its extensions/modules ). No, "php-mysqlnd", is not shipped by Plesk, as you can see as well, when you use the command:
Code:
yum info PACKAGE-NAME

In former times, "php-mysqlnd" was not supported by Plesk and instead, "php-mysql" has to be used. But this dependency has been expanded to both versions. ;) ( pls. see as well: => mysqlnd support for Plesk 11.5 ).


So is this the safe way to start using mysqlnd in plesk?
If Plesk declares something "to be supported", you can be sure, that it has been tested and therefore your question can be answered with: Yes!
 
Hi sjerp van wouden,
If Plesk declares something "to be supported", you can be sure, that it has been tested and therefore your question can be answered with: Yes!

I have followed through the steps I had found. Warning would not go away. Service restart didn't make a difference so I thought, I'll just reboot the machine, that'll restart all.
Now I've got 502s everywhere.

Aaarrghhhh....

I saw an error with an mysql table which was resolved through mysql_upgrade, as the system suggested. Yet 502s persist.

Ah yes, seems to be exactly the same problem as last time around. I find
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: no such file.
When I thought: lets restart the apache.
Which was what happened last time. Which was why I started this thread :(
Damn I would really not like to reinstall plesk entirely.

Full drama from the apache:


[root@vps-284144-5452 ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@vps-284144-5452 ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-06-07 15:45:19 CEST; 14s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 1121 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 1119 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 1119 (code=exited, status=1/FAILURE)

Jun 07 15:45:19 vps-284144-5452.hosted.at.hostnet.nl httpd[1119]: AH00526: Syntax error on line 30 of /etc/httpd/conf/plesk.conf.d/webmails/geenkin...l.conf:
Jun 07 15:45:19 vps-284144-5452.hosted.at.hostnet.nl httpd[1119]: Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such f...rectory
Jun 07 15:45:19 vps-284144-5452.hosted.at.hostnet.nl kill[1121]: kill: cannot find process ""
Hint: Some lines were ellipsized, use -l to show in full.
 
Last edited:
Hi sjerp van wouden,

pls. continue with the following commands:

Code:
plesk bin repair --restore-vhosts-permissions -v

plesk bin repair --update-vhosts-structure -v

plesk repair web -y -v

... and report back ( as well with corresponding log - entries from your panel.log ) for further investigations / solutions / work-arounds.



Additional informations:


Sometimes, it is as well a good idea to change the log - level ( TEMPORARILY! ), to get more informations in Plesk - log - files:

 
Hi,

I will do that. Last time around that didn't solve the issue but I'll give it a spin!

second command gave me exit code 1.


Arguments: Array
(
[0] => --reconfigure-all
)

Details: Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-server
[1] => -no-restart
)

Details: [2017-06-07 16:06:47] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-06-07 16:06:47] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-06-07 16:06:47] ERR [panel] Apache config (14968444060.42595600) generation failed: Template_Exception: AH00526: Syntax error on line 30 of /etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 30 of /etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory



Unable to update the structure of the home directory: an unexpected error has occurred.
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-all
)

Details: Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-server
[1] => -no-restart
)

Details: [2017-06-07 16:06:47] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-06-07 16:06:47] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-06-07 16:06:47] ERR [panel] Apache config (14968444060.42595600) generation failed: Template_Exception: AH00526: Syntax error on line 30 of /etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 30 of /etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory


exit status 1


Third command gave me exit code 1


Checking Plesk version
Installed Plesk version/build: 17.5.3 CentOS 7 1705170317.16

Checking for custom configuration templates ......................... [OK]

Checking for the JkWorkersFile directive in the Apache configuration [OK]

Checking associations between domains and IP addresses .............. [OK]

Checking for corrupted reference between IP collections and IP
addresses ........................................................... [OK]

Checking for links between APS applications and subscriptions ....... [OK]

Checking for the Zend extension declaraion in php.ini ............... [OK]

Check symbolic links for latest virtual host config files ........... [OK]

Checking for system users home directories consistency .............. [OK]

Checking for records with empty name field in the Configurations table[OK]

Checking for nginx ULIMIT value ..................................... [OK]

Checking for extra configurations in database not owned by any object [OK]

Repairing web server configuration
Reinstalling SSL/TLS certificates ............................... [OK]
Applying the default SSL/TLS certificate to all IP addresses .... [OK]
Repairing server-wide configuration parameters for web servers .. [2017-06-07 16:07:53] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/httpdmng' '--reconfigure-server'] with exit code [1]
[FAILED]
- httpdmng failed: [2017-06-07 16:07:53] ERR [util_exec]
proc_close() failed ['/usr/local/psa/admin/bin/apache-config'
'-t'] with exit code [1]
[2017-06-07 16:07:53] ERR [util_exec] proc_close() failed
['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code
[1]
[2017-06-07 16:07:53] ERR [panel] Apache config
(14968444720.85357200) generation failed: Template_Exception:
AH00526: Syntax error on line 30 of
/etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be
accessed: (2)No such file or directory

file:
/usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 30 of
/etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be
accessed: (2)No such file or directory
Updating the file of sharing passwords and permissions of users
according to actual information ................................. [OK]
Repairing web server configuration for all domains. This aspect
can be used with individual domains ("plesk repair web
example.com"), and on the server level ("plesk repair web") ..... [2017-06-07 16:07:54] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/httpdmng' '--reconfigure-all'] with exit code [1]
[FAILED]
- httpdmng failed: Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-server
[1] => -no-restart
)

Details: [2017-06-07 16:07:54] ERR [util_exec] proc_close()
failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with
exit code [1]
[2017-06-07 16:07:54] ERR [util_exec] proc_close() failed
['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code
[1]
[2017-06-07 16:07:54] ERR [panel] Apache config
(14968444740.16805500) generation failed: Template_Exception:
AH00526: Syntax error on line 30 of
/etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be
accessed: (2)No such file or directory

file:
/usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 30 of
/etc/httpd/conf/plesk.conf.d/webmails/geenkindaandekant.nl_webmail.conf:
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be
accessed: (2)No such file or directory

Checking the usage of PHP handlers

The following service plans have unregistered PHP handlers: ....... [ERROR]
- Admin Simple
- Default Domain
- Unlimited
- Default Simple
The issue could be resolved only in the interactive mode (without -y and -n options).

The following domains have unregistered PHP handlers: ............. [ERROR]
- vps-284144-5452.hosted.at.hostnet.nl
- paperjamcollective.nl
The issue could be resolved only in the interactive mode (without -y and -n options).

Error messages: 2; Warnings: 0; Errors resolved: 0


exit status 1

 
Hi sjerp van wouden,

pls. make sure, that all needed Plesk packages are installed and use as well the command:

Code:
plesk repair all -y -v
Pls. check issues/errors/problems in your Plesk - log - files and post the relevant log - entries for further investigations.
Pls. don't forget, that the "DEBUG - log - level" helps a lot to get to a root causes during investigations! ;)


If you investigate the logs, pls. make sure, that you solve issues like:
The following domains have unregistered PHP handlers: ............. [ERROR]
- vps-284144-5452.hosted.at.hostnet.nl
- paperjamcollective.nl
The issue could be resolved only in the interactive mode (without -y and -n options).
... before your continue with the initial issues/errors/problems, to avoid further ( mostly relating ) issues/errors/problems! :)

Pls. don't just wait for additional suggestions, when issues/errors/problems as shown appear, because it states pretty clear, what you should do - pls. don't hesitate to follow the suggestions from your logs and report back WHAT you did and what the result was, so that people willing to help you are informed about your steps! ;)


In addition, it could help as well to un- and re-install Plesk compoents, which often re-installs as well dependent packages.
Consider to list the installed packages with for example:

Code:
plesk installer --select-product-id plesk --select-release-current --show-components --show-options

... while the following commands remove or install a defined component with the Plesk installer:​

Code:
plesk installer --select-product-id plesk --select-release-current --remove-component phpgroup

plesk installer --select-product-id plesk --select-release-current --install-component phpgroup
 
Right before you posted that I ran the repair all command, I fixed the missing handlers, the "missing cgi_wrapper" issue persists. I set the debug level as your suggested and will run the second set of commands.
 
Hi sjerp van wouden,
pls. make sure, that all needed Plesk packages are installed and use as well the command:
Thanks for your continuing answers. I appreciate it quite a lot.

I would love to do that but I'm not aware which plesk packages are needed. Some are obvious, some are not. Is there a list somewhere which packages are minimum required?

I'm looking at that list via the command you showed me. Quite wary of removing things...

Also: if I remove a component and reinstall it, will it's related settings be gone?

the upgrade components command got me from a 502 to a 404 error, btw. Thought I try that first.

I'm not sure which plesk error logs you refer to btw.
 
Last edited:
Hi sjerp van wouden,

removing and adding Plesk components can't "destroy" something, in fact, it mostly helps to get yourself back to some standarts, which are defined in components related configuration files - so you might consider to declare such solutions/work-arounds rather as a sort of "repair". ;) But hey... it's up to you... I just try to help you with suggestions and investigations and you don't have to follow these suggestions. :)

I would suppose that uninstalling and reinstalling 'webservers' aka apache package would solve the issue?
I can't answer with "yes" here, because the statement "would solve the issue" can't be answered without a complete list of installed packages on your server, which might point to some missing ( depending ) components/packages.



If you are unsure about suggestions / investigations from forum users, pls. don't hesitate to contact the official Plesk Support, where experienced linux administrators help you to solve your issue(s). => https://www.plesk.com/contact-support
 
Back
Top