cannot install or use ZeroMQ library - zeromq

I am working on Debian Linux / Apache (a VPS at Dreamhost). I have tried to install ZeroMQ (version 3.2.3) as per these instructions. At the first glance, it looks like everything went well.
The sudo make install command proudly reports back that (among others)
Libraries have been installed in: /usr/local/lib
Indeed, here is the ls of /usr/local/lib:
libzmq.a libzmq.so libzmq.so.3.0.0 php python2.5 site_ruby
libzmq.la libzmq.so.3 ocaml pkgconfig python2.6
In order to use ZeroMQ I have added to my php.ini:
extension = /usr/local/lib/libzmq.so
But when I run PHP, I get:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
What am I doing wrong?
update
As per djf's answer, I worked my way through the instructions for PHP bindings (building from Github). Those seem to work. But then, when I run PHP I get:
PHP Warning: PHP Startup:
zmq: Unable to initialize module Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match in Unknown on line 0`
Now what?
update 2
Oh, wait a minute. I may know what that is. Dreamhost has PHP 5.2 on the command line. I need PHP 5.4, so I have been calling PHP like so /usr/local/php54/bin/php (this is apparently where the PHP 5.4 executable resides).
However, commands like configure and make use the ordinary, standard PHP. So I needed to upgrade CLI PHP to 5.4.
After that, everything worked. Thanks for the help, everyone!

Seems like you've only installed the C library, hence the error:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
You also have to build the PHP bindings. Check these instructions on howto build them.

I do this for windows but i thinks linux is same.
Just go to http://pecl.php.net/package/zmq/1.1.2/windows and download package that fit with your php version.
Then extract it and coppy 'libzmq.dll' to 'xampp/php' folder, 'php_zmq.dll' to 'xampp/php/etc'.
At the end of 'php.ini' add following line:extension=php_zmq.dll
Don't forget restart your xampp!Good luck

Related

We cannot install extension in admin panel in Magento 2.3.2

We have installed magento 2.3 community edition in windows. We use Xampp 7.2.20. Magento installation is done successfully and admin panel is running fine. But when we try to install any extension from extension manager section it shows different errors. The errors is like as followings:
Step 1: Readiness Check
Error! You need to resolve these issues to continue.
Check Updater Application Availability
Updater application is available.
Check Cron Scripts
Cron script readiness check passed.
Check Component Dependency
Component dependency is correct.
PHP Settings Check *
Need Help? PHP Extension Help
PHP Extensions Check
missing PHP extensions. Hide detail
The best way to resolve this is to install the correct missing extensions. The exact fix depends on our server, your host, and other system variables.
Our PHP extension help can get you started.
For additional assistance, contact your hosting provider.
In some cases, you might have two PHP configuration files: one for the PHP command line and for the web server. If so, make the change in both php.ini files. For details, see the php.ini reference.
We cannot understand what is the problem in php extension and php settings. We cannot understand which extension, library, module is missing to install extension.
If any one has solution please give us.
Check the following modules are installed and enabled on your server. This are the required PHP extension for Magento 2
bc-math
curl
gd, ImageMagick 6.3.7 (or later) or both
intl
PDO/MySQL
SimpleXML
soap
xml
xsl
zipmbstring
mbstring
mcrypt
mhash
openssl

Installing YAML for PHP in IIS

I am trying to install the YAML 1.2 extension to PHP 5.6 under IIS 10 (Windows 10). I am using http://pecl.php.net/package/yaml/1.2.0/windows to download the files.
I have downloaded the PHP 5.6 non-thread-safe DLL (x86 to match my version of PHP), copied php_yaml.dll to my extension directory, copied yaml.dll to C:\Windows\System32 (which is reported as one of the paths in phpinfo()) and added extension=php_yaml.dll to my php.ini. I've verified with phpinfo() that the correct php.ini file is being loaded, and commenting out other extensions removes them from the output of phpinfo().
However, YAML doesn't appear in the output of phpinfo() and the functions are not loaded. Running php-cgi.exe -v from the command line gives a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\php_5_06_14\ext\php_yaml.dll' - The specified module could not be found.
in Unknown on line 0
The file exists at the location specified and the permissions appear to be correct. What else can I do to get it working?
As far as I can tell, the use of PECL as package manager is being in dropping.
Having to install extensions in a server makes things more complicated and it depends on the environment, permissions, etc.
I'm sure someone could help you solve that (I haven't work on windows in years, so I can't)
But, instead I suggest you another solution. Maybe you can opt for it, maybe you have to stick with the extension, but, in case you can actually look for other option, I suggest you to use another library.
https://github.com/symfony/yaml
And, you could use Composer to install your libraries, I suggest you take a look at it.
Again, it may be for you or not, but I think this would be a lot easier.
I hope that helps.
I put the path to my extension directory in the path environment variable. That fixed the issue for me.

"Full REPL not supported. Falling back to simple shell" - error in Laravel While Trying To Use php artisan tinker

My Development Environment:
Windows 7 + WAMP
PHP Version: 5.4.16
While I try to use php artisan tinker - my console give me the following error:
REPL not supported. Falling back to simple shell
I search solution for this and found this :
Full REPL not supported
But this could not helped me much.I know Boris is By default supported by laravel 4.1.
And I might do some changes in php.ini according to this.
If the tinker command doesn't work for you, it is very likely the disable_functions setting in your php.ini contains the needed pcntl_() functions. Put a comment before this line in your php.ini and that should allow tinker to work.
Source :http://laravel-recipes.com/recipes/280
But when I Open my php.ini file the disable_functions contains nothing except this:
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
Is this My WAMP problem? Do I Missing Something !!!
Boris In Tinker
The php artisan tinker command now utilizes the Boris REPL if your system supports it. The readline >and pcntl PHP extensions must be installed to use this feature. If you do not have these extensions, >the shell from 4.0 will be used.
From the Laravel docs here:
http://laravel.com/docs/releases
So basically, they are telling you that php55-pcntl and readline needs to be installed.
Everytime I try to brew install php55-pcntl though, I get
configure: error: Cannot find openSSL's <evp.h>
Try running that and see what you get.
UPDATE: Use Laravel's Homestead environment
I completely gave up trying to run it on a XAMPP/WAMP/MAMP-style localhost.
If you go to the quickstart docs and scroll down to local development environment:
http://laravel.com/docs/quick#local-development-environment
It actually recommends you use Laravel's custom homestead environment:
http://laravel.com/docs/homestead
Read the docs for installing that and report back with results. It has been working perfectly for me.
One or more of readline posix and pcntl extensions are missing. You need to compile PHP with the appropiate configuration options to enabled it.
Here are the instructions:
readline http://www.php.net/manual/en/readline.installation.php
pcntl http://www.php.net/manual/en/pcntl.installation.php
posix http://www.php.net/manual/en/posix.installation.php
Note that posix functions are enabled by default.

php extension compiles with newer API version than my PHP

This is driving me nuts : I'm trying to compile a php extension for a library (www.phah.org), which compiles fine, but when I try to enable load it with php, I have the following warning (this is actually the output of make test):
PHP Warning: PHP Startup: pHash: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20090626
The confusing thing is when i do phpize before compiling, it shows the right API version :
$ phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
But it is still compiled with 20100525 (php 5.4) instead of 220090626 (php 5.3).
I spent quite some time searching, but I only found ppl having the opposite problem (extension compiling for an older version of php).
Any hints?
Well, I figured it out : instead of using the php bindings shipped with 0.9.6 sources, you can use either the 0.9.4 version from here https://github.com/sdepold/pHash, or this version as it is forked from 0.9.6, https://github.com/Alexis2004/php-phash
Both compile just fine without the API version problem. looks like it doesn't come from Zend apparently.

Laravel, enable MCrypt for CLI

I know the question was asked a lot, but most answers were for linux/xOS systems and no thread about windows,
Lately I'm trying to learn laravel which need mcrypt extension enabled which was easy with wampmanager and it worked fine, but the CLI using php artisan doesn't work and only dd Laravel requires the Mcrypt PHP extension.
I only have one version of php and accessing the php.ini.
I only find
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.modes_dir=
I've tried configuring it by downloading libmcrypt and setting it in php\ext with no avail.
Run php --ini to find out which config files are loaded.
CLI could use another config-file than php.ini.
EDIT:
Make sure the file got these things correct:
extension_dir This should point to your extension-directory. There may be a line there which you could just uncomment. Otherwise it's probably "ext/" or something like that.
Also, make sure
extension=php_mcrypt.dll is uncommented.
You can use php -info to check what extensions are available.

Resources