php 5.2.3 + mailparse

Support/Development for PHP
neekster
Forum User
Forum User
Posts: 5
Joined: Thu Oct 04, 2007 11:17 am

php 5.2.3 + mailparse

Unread post by neekster »

Hopefully someone can help me out here, this one's been driving me nuts.

I need to install php-pecl-mailparse on Centos 5 with PHP 5.2.3, but the only rpm I can find is
php-pecl-mailparse-2.1.1-1.el5.rf from rpmforge

It installs fine with php-5.2.3-4.el5.art but php refuses to load the module with the following error.


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

So I guess my question is anyone know of a MailParse rpm that will work with art?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

You or Scott would have to build it. Or you could use the pear command to build and install PECL extensions.
Lemonbit Internet Dedicated Server Management
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

or breun... come on... make an rpm... do it... do it... everybody does it.... it'll make you feeeeel goooood.**



** This type of peer pressure probably doesn't work in the Netherlands.
neekster
Forum User
Forum User
Posts: 5
Joined: Thu Oct 04, 2007 11:17 am

Unread post by neekster »

hahaha

Well I tell you one thing, me compiling an RPM will not make me feel good. Somebody hide the razor blades!

May look at the pear option when I have had more than 2 hours sleep :D
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

scott wrote:or breun... come on... make an rpm... do it... do it... everybody does it.... it'll make you feeeeel goooood.**
If everybody is doing it, then why do I feel like documentation on getting started with building rpms (and mock and friends, etc.) is scattered all over the web? I rebuild an rpm from time to time, but nothing fancy. I just haven't found the time to find all the pieces and put together a good build system and learn about building rpms for all these different platforms (though we're using almost exclusively CentOS 4 and 5).

Maybe you could do a screencast of you and your setup and building PHP packages for Plesk for instance sometimes? 8)
** This type of peer pressure probably doesn't work in the Netherlands.
You are absolutely correct, sir.
Lemonbit Internet Dedicated Server Management
neekster
Forum User
Forum User
Posts: 5
Joined: Thu Oct 04, 2007 11:17 am

Unread post by neekster »

Some sort of tutorial would be great.

Although I'm gonna have to head back to the centos php 5.1 rpm's. I did try compiling mailparse using pear, but I'm now getting errors with missing symbols.

Anyone know if I can removing the php 5.2 rpm's using --nodeps will allow me to reinstall php 5.1 without screwing plesk?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

You might need to install some extra packages before pear can compile the PECL extension. The error messages will give you a clue about what is needed. So, what's the error message?

Alternatively, if you want to downgrade, you can download the packages for the older version and use rpm -Uvh --oldpackage *.rpm to replace the packages.
Lemonbit Internet Dedicated Server Management
neekster
Forum User
Forum User
Posts: 5
Joined: Thu Oct 04, 2007 11:17 am

Unread post by neekster »

Thanks breun,

Yes error message would help! Although I gave up because I can't really find any reference anywhere to this symbol

/usr/lib/php/modules/mailparse.so: undefined symbol: mbfl_name2no_encoding in Unknown on line 0

It looks mbstring related to me, although it's installed and working, so it's a bit of a mystery.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

You probably need at least the php-devel package installed (and autoconf, automake and libtool).
Lemonbit Internet Dedicated Server Management
neekster
Forum User
Forum User
Posts: 5
Joined: Thu Oct 04, 2007 11:17 am

Unread post by neekster »

It's a mystery it seem's. I have all these packages installed, all I can think is there is something about the version of mbstring rpm I have... I may try upgrading to the 5.2.4 rpms in testing, never know I might get lucky!
ramorius
Forum User
Forum User
Posts: 10
Joined: Thu Jan 24, 2008 6:25 pm

mailparse won't compile

Unread post by ramorius »

I'm having the same problem (Can't get mailparse installed). On top of which, when I try to use pecl to compile the extension, it tells me that I need mbstring. I have php-mbstring 5.2.5 from ART, so I don't understand why it is asking for it again.

I'm running php 5.2.5 from ART.

Plesk needs mbstring, so uninstalling it/reinstalling it really isn't an option.

Any help is greatly appreciated,
Rob
ramorius
Forum User
Forum User
Posts: 10
Joined: Thu Jan 24, 2008 6:25 pm

Unread post by ramorius »

Got this working :) I'll share my solution for others (and my future reference.)

I found a post on another forum that said, since mbstring shows up in phpinfo, I could override the requirement safely. This is because the recent versions of PHP5 have a bug with the mbstring headers:
http://pecl.php.net/bugs/bug.php?id=6239

So, per the instructions, I changed

Code: Select all

/* just in case the config check doesn't enable mbstring automatically */
#if !HAVE_MBSTRING
#error The mailparse extension requires the mbstring extension!
#endif
to

Code: Select all

/* just in case the config check doesn't enable mbstring automatically */
#if !HAVE_MBSTRING && false
#error The mailparse extension requires the mbstring extension!
#endif
in the mailparse.c file

Then I manually compiled it:

Code: Select all

$ cd extname
$ phpize
$ ./configure
$ make
# make install
and everything works once the extension=mailparse.so is in the php.ini file (It was already there from my prior attempts to enable it.)

Hope that this helps someone!
Rob
caffeinated
New Forum User
New Forum User
Posts: 1
Joined: Thu Jun 26, 2008 8:49 am

Unread post by caffeinated »

Just managed to compile and install the mailparse extension under Redhat ES5 which doesn't provide an rpm.

The pecl install command wont run on a normal Redhat ES install for a load of reasons. main ones being /tmp doesn't allow execution of script (but you could use mount -o remount,exec /tmp) ; the mbstring module detect can be overridden with the pecl -n switch but you will still need access to the mbstring header files.

A workable solution is-

Code: Select all

wget "http://pecl.php.net/get/mailparse-2.1.4.tgz"
tar xfvz mailparse-2.1.4.tgz
cd mailparse-2.1.4
phpize
./configure
but before 'make' you will need the mbstring headers. get from the same version as your version of PHP, (I got them from redhat's srpm)
extract the tar.gz.

Code: Select all

cd php-5.1.6/ext/
cp -a mbstring ~/mailparse-2.1.4/ext/
then in mailparse-2.1.4

Code: Select all

make

[si@havana modules]$ file mailparse.so
mailparse.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
[si@havana modules]$  
install it......

Code: Select all

[si@havana modules]$ sudo su
[root@havana modules]# cp mailparse.so /usr/lib64/php/modules/
[root@havana modules]# echo "extension=mailparse.so" > /etc/php.d/mmailparse.ini
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


reload apache and check the output of phpinfo() to check it has loaded.
mrwilson
Forum User
Forum User
Posts: 53
Joined: Sat Jun 07, 2008 11:09 pm

Unread post by mrwilson »

I also need mailparse on a server with Centos 5 and PHP 5.1.6, a helpdesk application requires it (Cerberus Helpdesk 4).

I don't use ASL yet.

Right now yum doesn't have it.

If I install ASL, is it available from there yet or would I still need to compile it myself?


Update: I figured out that if I add the RPMforge repo I can get mailparse easily with yum install php-pecl-mailparse
Last edited by mrwilson on Tue Aug 19, 2008 10:58 am, edited 1 time in total.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Not in ASL, but I could add a mailparse rpm for 5.2.x in atomic.
Post Reply