Is there a version of Mailparse that works with PHP 5.6.2? I installed it this morning using pecl install mailparse and it placed mailparse.so in what seems to be the wrong location and when I view it in Finder it shows up as a document.
I decided for the heck of it to copy it to the appropriate folder and when I execute the code the uses it I get these messages:
Warning: PHP Startup: mailparse: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
FYI, I'm not a PHP expert by any stretch.
For php 5.6 and debian first install php5-dev module:
apt-get install php5-dev
and next use latest build for php5, which is currently:
pecl install mailparse-2.1.6
If mailparse is already installed you can remove it before any action:
pecl uninstall mailparse-2.1.6
Officially, no, there's not.
http://php.net/manual/en/mailparse.installation.php
Windows users will enable php_mailparse.dll inside of php.ini in order
to use these functions. A DLL for this PECL extension is currently
unavailable. See also the building on Windows section.
It seems to be just a matter of compiling, so anyone should be able to compile it and share the DLL, but as far as I know no one has done this.
mailparse hasn't had a release for some years - though the git repo is showing recent work (April 2015). I recently used it for a project, however the version I used had some issues in decoding the display-name & email from a list of not perfectly formatted string of multiple names.
I've since installed mmucklo/email-parse and I'm using that as a native PHP solution on PHP 5.6.
Related
I installed PHP 7.4 and RdKafka by using PECL however the module didn't start, here is the output of php -v
PHP Warning: PHP Startup: rdkafka: Unable to initialize module
Module compiled with module API=20210902
PHP compiled with module API=20190902
These options need to match
I assume that maybe my rdkafka module is to recent for this PHP binary, and I tried to install older version by doing ->
sudo pecl uninstall rdkafka && sudo pecl install rdkafka-4.0.0
According to pecl.php.net website, this version is the closest to my PHP binary compiled module ( https://pecl.php.net/package/rdkafka )
However there is an error while compiling the source code of this version.
make: *** [Makefile:205: rdkafka.lo] Error 1
I also tried several solutions proposed on various sources but I can not figure out how to make it work, and I havnt used PHP for like 10 years so my knowledge are very bad.
Anyone know how to fix or can give me some lead ?
I kind of solved the problem, instead of looking for a older version of this kafka module ( which does not compile on my system ), I tried with a newer version of PHP ( 8.1 ) and it run perfectly. Luckily for me it is compatible with my code base
I am using xampp php version 7.4 on windows and got the same error .
In my case commenting out the extension in php.ini for lib sodium did the trick.
extension=php_sodium.dll
Please help with php 7 extensions on CentOS 7.
When trying to isntall extension, for example memcache and memcached using the command yum --enablerepo=remi-php74 install php-memcache php-memcached I got the message that this packages are already installed.
php --modules also shows they are present. But I can't find them in /etc/opt/remi/php74/php.d and /opt/remi/php74/root/lib64/php/modules.
I attached screenshot of phpinfo() as well phpinfo, there are no additional extensions...
Please advice what I'm doing wrong, I'm not very strong in this DevOPS things :-)
Also added php --ini response php --ini
For a proper installation please follow the Wizard instructions
If you need a single version, php-* packages are simpler to install and use
If you need multiple versions, php74-php-* are available
You can read the repository FAQ: Difference between php-* and php##-php-* packages ?
So as you are running php74-php you need
yum install php74-php-pecl-memcache php74-php-pecl-memcached
But if you need a single version, probably better to remove all php74* packages and only use php-* ones.
I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd ext/intl/
Run these commands to build the extension
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846
I'm trying to get the latest Mongo Driver to work with MAMP 1.9.6 on OS X 10.5.8.
I built it successfully from source since it seems that there are no pre-compiled releases, included it into the right directory and restarted the apache.
But PHP doesn't recognize the extension. I used the 1.0.11 driver previously which worked fine, but I need the new version, because Doctrines ODM requires it.
When I replace the 1.2.10 mongo.so with the 1.0.11 and restart apache mongo is available. I don't get what could be wrong.
Anyone had this behaviour or any guesses to get this to work?
Update: The PHP error log shows the following:
[01-Jun-2012 22:02:37] PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
I'm not quite sure what it means?
2. Update:
I was finally able to sync the API version of phpize.
But now I'm not able to build the driver anymore.
I do the following:
phpize
./configure
make
sudo make install
But at the make command I'm getting tons of syntax errors. Seems that it can't find several header files.
The very first one is the zend_config.h and really I just have those other two files:
zend_config.nw.h
zend_config.w32.h
I downloaded the MAMP components to get this files. Why am I missing this one? And there are a lot of others.
I'm using PHP 5.3.5 Is there a way to get those header files from a different source?
I followed the instructions at Develop MongoDB web apps with MAMP under Mac OS X to successfully build mongo.so for MAMP with php 5.3 on OS X 10.7.3.
I'm adding this for historical purposes -- I guarantee that if you're having the same set of problems, you'll want to do this.
Personally, I had a really difficult time getting MAMP's php version to play nicely with the extension builds that I was trying to make.
I discovered that the problem was that MAMP really hadn't been set up to add extensions in general, and during the compilation of the mongo php drivers, it wasn't installing it in the right place -- so I followed the following tutorial on preparing MAMP for additional pecl and pear extensions.
After following those steps to prepare MAMP for adding extensions, you can easily install any extension.
At the part where it starts talking about adding an extension, use sudo pecl install mongo and restart apache from your MAMP interface.
I ran into the same problem when upgrading from PHP 5.3 to 5.4 and was able to solve it by following these steps:
Make sure to upgrade php5-cli as well as just php5 and php5-common
Uninstall the mongo drive
sudo pecl uninstall mongo
Re-install the mongo driver
sudo pecl install mongo
I've been trying to install some PECL extensions on my laptop, but I've ran into a few problems. Whenever I run pecl install whatever from the command line I get a message saying ".\php.exe appears to have a suffix .exe, but config variable php". It seems like PECL is using PEAR to perform installations. I checked and php_suffix is located in the files PEAR_Config.php and PEAR_Builder.php, but I'm not sure what to do with it in there.
Any ideas on how to fix this or workarounds? Unfortunately the pecl4win seems to be down, and http://downloads.php.net/pierre/ the site I usually go to for the .dll's has outdated versions for the version of PHP I'm using (5.3.1).
Unfortunately I don't know the specifics, but at least I can point you in the right direction To use pecl on windows, you need to setup Visual Studio c/c++ or MingW32 c/c++ and then configure pecl to use either compiler for building the requested extensions.
Unlike pear packages, pecl packages are PHP c extensions that needed to be compiled against your local PHP install.
Update
https://wiki.php.net/internals/windows/stepbystepbuild A mostly friendly wiki page on setting up a windows box for building PHP from source. Looks like you need to build the interpreter and support libraries before you can get pecl working.