mysqli::real_connect(): Headers and client library minor version mismatch. Headers:50614 Library:50544 - mysqli

codeigniter 3.0.6 gives error
mysqli::real_connect(): Headers and client library minor version mismatch. Headers:50614 Library:50544

I had the same problem when i updated my mysql server or client version, what you have to do is install mysqlnd, you can use
yum install php54-mysqlnd
it depends on your php version, you can check it using phpinfo(); or running php -i on bash

Related

memcached Version 3.0.4 does not have REST xml available install failed

i follow a tutorial from plesk to install memcache(d), he say put this line:
/opt/plesk/php/7.2/bin/pecl install memcached
But this work not and i get this error:
Package "memcached" Version "3.0.4" does not have REST xml available
install failed
What i can do? Have any a how to for noobs? :-)
Best regards, Stefan
Can't reproduce this error. I have successfully compiled module with
yum install plesk-php72-devel gcc make libmemcached-devel
/opt/plesk/php/7.2/bin/pecl install memcached
libmemcached directory [no] : /usr

Xdebug bad Zend API Version Number

I am having trouble upgrading xdebug for MAMP. I was running version 2.2.0 and there was a known issue that I ran into: PhpStorm and Xdebug not breaking in Symfony2 Controller
I tried to upgrade to version 2.2.3 by following the instructions from http://xdebug.org/wizard.php
After downloading and extracting the xdebug tar I ran /Applications/MAMP/bin/php/php5.4.4/bin/phpize
Here is the output:
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
I then copied the modules/xdebug.so file into the mamp php5.4.4 extensions dir: `/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.
If I run /Applications/MAMP/bin/php/php5.4.4/bin/php -v I get the following:
Xdebug requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.
PHP 5.4.4 (cli) (built: Jul 4 2012 17:28:56)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
I have restarted MAMP and Apache and tried loading a page with phpinfo() and I do not see Xdebug listed. If I moved the old xdebug.so file back in place the error is removed and phpinfo() show xdebug as enabled
I managed to solve this issue by running
/Applications/MAMP/bin/php/php5.4.4/bin/pecl install xdebug At first I was seeing issues with the Zend API number using pecl. I followed this post: pecl installs for previous php version and set the following:
sudo /Applications/MAMP/bin/php/php5.4.4/bin/pear config-set php_ini /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
sudo /Applications/MAMP/bin/php/php5.4.4/bin/pecl config-set bin_dir /Applications/MAMP/bin/php/php5.4.4/bin/
Not sure if these configs had something to do with it failing before
I have a MAMP server set up on a Mac Pro, I could not get xDebug to work. This was in my logs:
PHP Warning: PHP Startup: xdebug: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match
in Unknown on line 0
This can be fixed by installing the latest xDebug.so. My problem with doing so was that is was writing to the wrong xDebug.so,not the MAMP server:
Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so): failed to open stream: Operation not permitted)
The second line of #Shawn's answer was the solution:
sudo /Applications/MAMP/bin/php/php7.2.7/bin/pecl config-set bin_dir /Applications/MAMP/bin/php/php7.2.7/bin/
I was then able to build the latest xDebug.so to the right directory using pecl install xdebug.

imagick and mongo on OSX lion with brew

I am trying to install imagick and mongo on osx lion. Note that my php installation is done via homebrew. I have installed the packages correctly and it should work but php returns the following
Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
Any clues on how to fix that?
The PHP errors indicate that you've compiled extensions for a different API version (20090626 API is PHP 5.3) from the server you are trying to use the extensions with (20100525 API is PHP 5.4).
I suspect that you have installed PHP 5.4 via homebrew, but managed to pick up the OS X default headers (PHP 5.3) when compiling the extensions. You need to either recompile your extensions with PHP 5.4, or downgrade your web server to PHP 5.3.
You can check the version of PHP headers in your path using php-config:
php-config --version
And the version of PHP and extension API with:
php -i | egrep "PHP (Extension|Version)"
Possible fixes:
Include /usr/local/bin in your path first so the homebrew PHP versions are found in preference to the system default:
export PATH=/usr/local/bin:$PATH
Install PHP 5.3 via Homebrew:
brew uninstall php54
brew install php53
For reference, I'd like to add that
when brew installs php it sets the additional ini files read folder to
/usr/local/etc/php/5.4/php5/conf.d
whilst it actually is
/usr/local/etc/php/5.4/conf.d
you can easily fix that by symlinking
cd /usr/local/etc/php/5.4/
mkdir php5
cd php5
ln -s ../conf.d .

MongoDB Install Error

Just setup a fresh server at MediaTemple (dedicated virtual / CentOS Linux) and installed the developer tools, but Mongo won't install, any ideas?
Also, it's trying to DL version 1.2.10 I assume I can run pecl upgrade mongo once it is installed to go to 2.0.6 right?
Here's my output:
[root ~]# pecl install mongo
downloading mongo-1.2.10.tgz ...
Starting to download mongo-1.2.10.tgz (86,463 bytes)
.....................done: 86,463 bytes
36 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/mongo-1.2.10
running: /root/tmp/pear/cache/mongo-1.2.10/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/cache/mongo-1.2.10/configure' failed
You're not installing mongodb with pecl, here you're installing the PHP driver for mongodb.
To install mongodb on CentOS, please follow these instructions here. These instructions show you how to add the 10gen repo, which will then enable you (using yum) to install the latest production-ready mongodb release (2.0.6).
I realise that it's not Ubuntu but egarding your issue with installing the PHP driver, does it make any difference if you run
sudo pecl install mongo
There's some information here on installing the mongo php driver, just replace the 'apt-get' elements with 'yum' as the same libraries, dependencies apply afaik.
Here's a tutorial on using the mongo php driver.

PHP :mbstring module install

I have tried to install the mbstring module for PHP. I have entered the below commands:
yum install php-mbstring
/usr/local/apache/bin/apachectl restart
Module is now installed but the errors has not dissapeared.
Fatal error: Call to undefined function mb_send_mail()
In my phpinfo(), "mbstring" doesn't exist...
OS: centos 6
PHP: 5.3.8
How did you install PHP on your system? The PHP version currently supported via YUM install is 5.3.3, but you said your PHP version is 5.3.8 which leads me to believe that you may have compiled PHP manually. If so, you will have to recompile with the --enable-mbstring flag.