laravel installation mcrypt unable to initialize module - php

im trying to install laravel 4 on my mac mavericks os with xampp server.
I solved several problems but a cant With This:
Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
i understund the problem , but i dont know how to fix it.
thanks a lot !

brew reinstall mcrypt --build-from-source php56-mcrypt --build-from-source
You may only need the php56-mcrypt module.

Are you using Homebrew? If so, you need to brew tap homebrew/php and then brew install php55-mcrypt.
If you're not using Homebrew, then you really should be. (Xampp probably isn't the way to locally develop Laravel either...) Check out Jeffrey Way's http://laracasts.com. There are a couple of free videos in the series Laravel From Scratch that should answer some installation questions.

Related

PHP 8.1 - Mac M1 - brew - MongoDB error "symbol not found in flat namespace '_u_strFromUTF8_67'"

I'm facing this error
PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /opt/homebrew/lib/php/pecl/20210902/mongodb.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mongodb.so, 0x0009): symbol not found in flat namespace '_u_strFromUTF8_67'), /opt/homebrew/lib/php/pecl/20210902/mongodb.so.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mongodb.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mongodb.so.so' (no such file))) in Unknown on line 0
I'm on on Mac with Apple Silicon, php 8.1 installed with "brew tap shivammathur/php".
I'm trying to use php with mongodb, installed with "pecl install mongodb".
When I add extension=mongodb.so or extension="mongodb.so" to my php.ini, I receive this error.
I try to follow another post with a similar error, but with no different result.
"symbol not found in flat namespace '_PHP_MD5Init' " Error encountered in loading redis dynamic library
The same approach I used to install xdebug and no problem occoured.
Any help?
What I missed?
Just for info, pecl list print out:
Package Version State
mongodb 1.14.2 stable
Other things maybe can be useful:
macOs 12.6
php 8.1.11
mongodb 1.14.2
mongocli 1.27.0
Xdebug is also installed by pecl and it works, so I guess it must be something wrong with mongodb's package or something
You compiled mongodb with icu4c 67.1 as dependency and brew most likely updated it.
To fix this make sure icu4c is the latest version and compile the MongoDB
extension again.
brew update
brew upgrade icu4c
pecl install -f mongodb
Alternatively, you can remove the extension installed using pecl and use the homebrew tap I maintain.
https://github.com/shivammathur/homebrew-extensions
pecl uninstall mongodb
brew tap shivammathur/extensions
brew install shivammathur/extensins/mongodb#8.1

ubuntu, php 7.4 and module rdkafka doesnt work because of compiled module version mismatch

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

Installing PHP 7.2 thread-safe on a mac

I'm trying to install PHP 7.2 thread-safe on a mac (Sierra 10.13).
I've tried:
with homebrew, using the --with-thread-safety option, but it's not recognized anymore
recompiling PHP with the --with-tsrm-pthreads option passed to ./configure, but failed
brew install php72 --with-thread-safety Warning: php: this formula has no --with-thread-safety option so it will be ignored!
Any suggestion?
In the end, I solved installing it through phpbrew.
Homebrew has started a migration of PHP related formulaes a while ago, so most of the parameters on most of the guides will not work anymore until someone will add support for them to the formulae.
Also, for most of the packages from now on Brew team recommends to use PECL.
You can try to build with flag --enable-maintainer-zts that should enable thread safety, it actually has worked out for me.

Laravel and Brew installation with PHP and PDO

I have just moved from linux to mac and am having some issues installing PHP with the right drivers for Laravel.
I ran brew install homebrew/php/php56-mysqlnd_ms
but now I keep getting this error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
phpinfo()
PHP Version => 5.6.21
Does anybody know how to fix this error? I am at a loss
You are missing mcrypt . You can try ,
brew install php54-mcrypt --without-homebrew-php
And then , in /etc/php.ini add,
extension="/usr/local/Cellar/php54-mcrypt/5.4.24/mcrypt.so"
I hope this will help , please let us know
Seems that you have to install the module mcrypt of php.
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
sudo composer update
Other thing that if you want to use mac and linux you can use Vagrant, is really nice how it works with virtualbox + vagrant you can have stack on other OS.
https://www.vagrantup.com/
And this is a nice project with vagrant for install all the the technologies you need.
https://github.com/fideloper/Vaprobash

Mongo PHP Driver 1.2.10 with MAMP

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

Categories