• 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

Multiple PHP Versions in Plesk 12.0 Out of the Box!

Try to find it with

# cd /usr/local/php56-cgi/
# find . -name *cli
I've already mentioned this directory above, I've tried to add this path to -clipath, but it gives an error:

root@host:/usr/local/php56-cgi# /usr/local/psa/bin/php_handler --add -displayname php-5.6.13 -path /usr/local/php56-cgi/bin/php-cgi -phpini /usr/local/php56-cgi/etc/php.ini -clipath /usr/local/php56-cgi/include/php/sapi/cli -type fastcgi -id 2
[2015-10-21 14:46:43] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/php_handlers_control' '--add' '--path' '/usr/local/php56-cgi/bin/php-cgi' '--phpini' '/usr/local/php56-cgi/etc/php.ini' '--type' 'fastcgi' '--displayname' 'php-5.6.13' '--id' '2' '--clipath' '/usr/local/php56-cgi/include/php/sapi/cli'] with exit code [1]
Unable to register the PHP handler: can not get version from /usr/local/php56-cgi/include/php/sapi/cli

In the directory /usr/local/php56-cgi/include/php/sapi/cli exist a file cli.h, all contents of this file you can be seen in the spoiler.
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2015 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Johannes Schlueter <[email protected]> |
+----------------------------------------------------------------------+
*/

/* $Id$ */

#ifndef CLI_H
#define CLI_H

#ifdef PHP_WIN32
# define PHP_CLI_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_CLI_API __attribute__ ((visibility("default")))
#else
# define PHP_CLI_API
#endif


extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC);

typedef struct {
size_t (*cli_shell_write)(const char *str, uint str_length TSRMLS_DC);
int (*cli_shell_ub_write)(const char *str, uint str_length TSRMLS_DC);
int (*cli_shell_run)(TSRMLS_D);
} cli_shell_callbacks_t;

extern PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks();

#endif /* CLI_H */

/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
 
Last edited:
/usr/local/php56-cgi/include/php/sapi/cli is incorrect path. There should be path to php-cli binary file. Do you have /usr/local/php56-cgi/bin/php file?
 
I faced with other issue. Connection via mysqli. I use a simple check of connection and have that error:
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /var/www/vhosts/domain.tld/httpdocs/mysqli-check.php
connection was not established No such file or directory

<?php
$con = mysqli_connect('localhost','use','123','test_db');
if (mysqli_connect_errno())
{
echo 'connection was not established' . mysqli_connect_error();
}
?>
 
Last edited:
Try to change localhost to 127.0.0.1 in your mysqli-check.php file.
 
Try to change localhost to 127.0.0.1 in your mysqli-check.php file.
Yeah, it works! ) But how can I fix it? Many customers define database connection as a "localhost" and furthermore "localhost" works fine for php 5.3.x by default.
 
What is output of following SQL query

select host, user from mysql.user;

?
 
mysql> SELECT USER from mysql.user;
+------------------------+
| USER |
+------------------------+
| % | test27 |
| localhost | admin |
+-----------+-----------+
 
Last edited:
G'day firends ;-)
just upgraded plesk to 12.5 on deb squeeze, coming from 11.09 -> 12.x -> 12.5 so far everything runs smooth, but there are no additional php versions.
 
Hi prateekvarma,

On just pressing enter, it gives some error

Sorry, but we really can't guess your error messages, which help to investigate issues/problems. Please consider to post corresponding error messages and be aware, that additional informations about your operating system and the current Plesk version ( incl. MU ) in use help as well to investigate your issue/problem. Error descriptions like "doesn't work", or "it gives some error" won't help at all to find a cause. :(

Did you as well notice the awesome "Plesk DevBlog" - article:

 
Hi prateekvarma,

Sorry, but we really can't guess your error messages, which help to investigate issues/problems. Please consider to post corresponding error messages and be aware, that additional informations about your operating system and the current Plesk version ( incl. MU ) in use help as well to investigate your issue/problem. Error descriptions like "doesn't work", or "it gives some error" won't help at all to find a cause. :(

Did you as well notice the awesome "Plesk DevBlog" - article:

Hi, i'n using plesk 12.0.18
I used my root access and typed this command
-------------
/opt/plesk/php/5.6/bin/pecl install memcached
----------------

, and the message is ->
-----------------
libmemcached directory [no]
------------------
It looks like it wanted me to input something, but i have no idea what this is. Any ideas?
 
Hi prateekvarma,

It looks like it wanted me to input something, but i have no idea what this is. Any ideas?

Sure... and the above mentioned article from the Plesk DevBlog already answered your question:

Then we build the module:

# /opt/plesk/php/5.6/bin/pecl install memcached

(when prompted for the libmemcached directory, leave it blank and hit the Enter key)

:D:):D

In addition, you should be informed, that if you didn't install the depending "libmemcached-devel" package ( you can install it with "yum" on CentOS/RHEL - based systems ) or the depending "libmemcached-dev" package ( with "apt-get" or "aptitude" on Debian/Ubuntu - based systems ), then you might experience issues/problems, after hitting the Enter key, because PECL doesn't find the headers in the default libmemcached directory for its installation.
 
Hi prateekvarma,



Sure... and the above mentioned article from the Plesk DevBlog already answered your question:



:D:):D

In addition, you should be informed, that if you didn't install the depending "libmemcached-devel" package ( you can install it with "yum" on CentOS/RHEL - based systems ) or the depending "libmemcached-dev" package ( with "apt-get" or "aptitude" on Debian/Ubuntu - based systems ), then you might experience issues/problems, after hitting the Enter key, because PECL doesn't find the headers in the default libmemcached directory for its installation.
Indeed i got an error, i'm sure i don't have the "libmemcached-devel" package. What would be the right way to install it?
 
Hi prateekvarma,

What would be the right way to install it?
hmmmmm..... I thought I already answered that:
...
that if you didn't install the depending "libmemcached-devel" package ( you can install it with "yum" on CentOS/RHEL - based systems ) or the depending "libmemcached-dev" package ( with "apt-get" or "aptitude" on Debian/Ubuntu - based systems ),
...

yum usage to install something:

yum install PACKAGE_NAME
apt-get / aptitude - usage to install something:

apt-get install PACKAGE_NAME
aptitude install PACKAGE_NAME
 
Back
Top