Page 1 of 2
php 5.2.3 + mailparse
Posted: Thu Oct 04, 2007 11:30 am
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?
Posted: Fri Oct 05, 2007 7:02 am
by breun
Posted: Fri Oct 05, 2007 7:12 am
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.
Posted: Fri Oct 05, 2007 7:20 am
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
Posted: Fri Oct 05, 2007 7:40 am
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?
** This type of peer pressure probably doesn't work in the Netherlands.
You are absolutely correct, sir.
Posted: Fri Oct 05, 2007 1:51 pm
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?
Posted: Fri Oct 05, 2007 2:22 pm
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.
Posted: Sat Oct 06, 2007 3:36 am
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.
Posted: Sun Oct 07, 2007 6:38 am
by breun
You probably need at least the php-devel package installed (and autoconf, automake and libtool).
Posted: Tue Oct 09, 2007 4:04 am
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!
mailparse won't compile
Posted: Wed Mar 12, 2008 5:21 pm
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
Posted: Wed Mar 12, 2008 6:27 pm
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
Posted: Thu Jun 26, 2008 10:37 am
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.
Posted: Tue Aug 19, 2008 3:36 am
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
Posted: Tue Aug 19, 2008 10:57 am
by scott
Not in ASL, but I could add a mailparse rpm for 5.2.x in atomic.