PHP 5.29 on CentOS and mailparse [SOLVED]

The recent upgrade of Cerberus Helpdesk involved upgrading to PHP 5.2 bleeding edge on CentOS which went off smoothly after following the instructions for this upgrade.

There is one package missing for me, and that is php-pecl-mailparse so found it in RPM Forge and performed the installation from Virtualmin >> Software packages

message from apache logs on restart:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mailparse.so' - /usr/lib/php/modules/mailparse.so: undefined symbol: mbfl_name2no_encoding in Unknown on line 0 PHP Warning: PHP Startup: mailparse: Unable to initialize module\nModule compiled with module API=20050922, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=0\nThese options need to match\n in Unknown on line 0

On investigating this, I realised that I would have to try and configure mailparse by ‘wget’ a mailparse.tgz file. However, before ‘make’ I would need the mbstring headers from the same version as the version of PHP installed. Is this possible?

Is there any process for this with the bleeding edge repos to getphp- pecl-mailparse properly configured?

Has anyone done this?

Regards.

Yeah, the php-pecl-mailparse package you’re trying to use probably wasn’t compiled for the PHP version you’re using.

The “mailparse” module is part of PHP’s PECL repository, details on it are here:

http://us.php.net/manual/en/intro.mailparse.php

You should be able to manually install it from the command line, using this command:

pecl install mailparse

Thanks for the response.

What I did was uninstall the rpm
rpm -e php-pecl-mailparse

Restarted Apache then:
pecl install mailparse
WARNING: channel “pecl.php.net” has updated its protocols, use “pecl channel-update pecl.php.net” to update
pecl/mailparse requires PHP extension “mbstring”
No valid packages found
install failed

mbstring is already there in the bleeding edge

Appreciate any feedback from anyone if they have managed to configure mailparse in CentOS with the bleeding edge PHP repo.

Regards.

What does this show:

rpm -qa | grep mbstring

[root@host ~]# rpm -qa | grep mbstring

php-mbstring-5.2.11-1.el5.vmbleed

Sorry to bring this up again, but with cerberus 5 just out I’m trying to give it a shot but cannot without mailparse.

As stated above, I have the bleeding edge php repo with centos 5.5

From the cerberus wiki I used the -n flag to install with pecl as they state that “Since mbstring is likely installed as an RPM, rather than through pecl, it won’t recognize it as being already installed. As a result of this you must use the ‘-n’ (no dependencies) flag when installing with pecl.”

#pecl install -n mailparse
WARNING: channel “pecl.php.net” has updated its protocols, use “pecl channel-update pecl.php.net” to update
warning: pecl/mailparse requires PHP extension “mbstring”
downloading mailparse-2.1.5.tgz …
Starting to download mailparse-2.1.5.tgz (37,332 bytes)
…done: 37,332 bytes
9 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize’ failed


Doing a search for ‘phpize failed’ shows that php5-dev has to be installed. What do I have to do as I have the virtualmin bleeding edge repo?

You can run “yum install php-devel”, that will install the PHP dev package, which includes phpize.

-Eric

Thanks for that, Eric.

The last few lines of building were:

Build process completed successfully Installing '/usr/lib/php/modules/mailparse.so' install ok: channel://pecl.php.net/mailparse-2.1.5 configuration option "php_ini" is not set to php.ini location You should add "extension=mailparse.so" to php.ini

I added extension=mailparse.so to php.ini and restarted Apache

From /etc/httpd/logs/error_log

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mailparse.so’ - /usr/lib/php/modules/mailparse.so: undefined symbol: mbfl_name2no_encoding in Unknown on line 0

Note that I’ve called the ini file ‘mmailparse.ini’ as the php.d ini files are loaded in alphabetical order. Mailparse needs mbstring so it needs to be loaded first or else you will get a warning like … PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/mailparse.so’ - /usr/lib64/php/modules/mailparse.so: undefined symbol: mbfl_name2no_encoding in Unknown on line 0
Source: http://www.grafxsoftware.com/faq.php/HOW-TO-Setup-a-PLESK-Dedicated-Server/1/4/ #20

[root@host etc]# cd /usr/lib/php/modules
[root@host modules]# ls
dbase.so imap.so mbstring.so mysql.so pdo_odbc.so pdo_sqlite.so snmp.so xmlwriter.so
dom.so json.so mcrypt.so odbc.so pdo_pgsql.so pgsql.so xmlreader.so xsl.so
gd.so mailparse.so mysqli.so pdo_mysql.so pdo.so phpcups.so xmlrpc.so zip.so
[root@host modules]# echo “extension=mailparse.so” > /etc/php.d/mmailparse.ini
[root@host modules]# cd /etc/php.d
[root@host php.d]# ls
dbase.ini imap.ini mcrypt.ini mysql.ini pdo_mysql.ini pdo_sqlite.ini xmlreader.ini xsl.ini
dom.ini json.ini mmailparse.ini odbc.ini pdo_odbc.ini pgsql.ini xmlrpc.ini zip.ini
gd.ini mbstring.ini mysqli.ini pdo.ini pdo_pgsql.ini snmp.ini xmlwriter.ini