hex2bin()

Hello Forum,

I have this Error Message in my Logfile:

Sep 11 18:23:42 server php: PHP Fatal error:  Call to undefined function hex2bin() in /usr/share/kopano/php/mapi/mapi.util.php on line 36

What is my Problem?

The System is CentOS 6 Apache2 / PHP5.6.5
Kopano 8.6.7.0

Hi yythoss,

hex2bin is part of PHP since 5.4.0, so you should check if the correct PHP version is loaded.

Manfred

Hi Manfred,

I check this with phpinfo, the current versin of PHP is 5.6.5
I search with grep for this function and I only find it under:

/usr/share/z-push/lib/utils/compat.php

But /usr/share/z-push/lib/utils/ is not in the include path of kopano.

Hi yythoss,

according to http://distrowatch.org/table.php?distribution=centos the default PHP version for CentOS is 5.3.3. How did you install 5.6.5? Did you restart apache after installing the new PHP version?
Where did you check phpinfo? CLI or some PHP script?

Manfred

Hi,

when I installed kopano, yum installed also httpd24 and php56 to /opt/rh/
I wrote a php script that let me show the phpinfo

Hi yythoss,

@yythoss said in hex2bin():

Hi,

when I installed kopano, yum installed also httpd24 and php56 to /opt/rh/
I wrote a php script that let me show the phpinfo

Where did you run the script? On the command line or did you open it in browser?

Manfred

In a Browser with the IP Adresse from the Server.
I am a programmer, I get such simple things

But if your PHP does not know hex2bin it seems to use a different PHP version than where you got the phpinfo from.

If you install kopano core-8.6.XX-RHEL_6_PHP_56-x86_64, kopano-dagent needs the package rh-php56-php, which in turn needs httpd24-httpd.
So it is clear which Apache and which PHP version is running.
PHPInfo always gives you an overview of the current web server, in this case 5.6.5.
It is also not possible that I have a wrong PHP version at the start, which installs this version of PHP itself. I think I’m missing a php rpm, but I do not know which package contains hex2bin.

Here is a sceenshot from phpinfo:

alt text

@yythoss said in hex2bin():

I do not know which package contains hex2bin.

as far as i can see this should be a built in function of php.

Hi yythoss,

as Felix already said, hex2bin is a built-in function in php.

Then maybe something’s wrong with your webapp configuration. Maybe it’s configured to use php-fpm and you need to restart it as well?

Manfred

Is there a howto of php-fpm

Hi yythoss,

the php-fpm was just a guess. In the knowledge base there’s php-fpm how-to with nginx: https://kb.kopano.io/display/WIKI/Nginx.

If you would provide more details on how have you installed Kopano and other components, it would be easier to track the issue. Now it’s just poking around in the dark.

Manfred

Ok I think nginx is not needed.
I installed kopano as described in this howto:

Kopano Wiki

yum install kopano-server-packages

Hi Forum,

I find the Problem.
php 56 was installed to /opt/rh/rh-php56/ and the command line php programm was stored in

/opt/rh/rh-php56/root/usr/bin/php

php was not found on this Maschine on the command line, so I make a symbolic link:

ln -s /opt/rh/rh-php56/root/usr/bin/php /usr/bin/php

now hex2bin was found on the command line and everything is fine.