Mcrypt PHP extension required on MacOS Yosemite Apache - php

When running a php command in terminal I keep getting "Mcrypt PHP extension required." I have installed Mcrypt using the instructions here and phpinfo does show that it is enabled (Version: 2.5.8, Api No: 20021217). How can I get this to work to stop PHP from erroring?

Judging by the linked instructions, you've probably enabled the extension only for the SAPI used by Apache.
There's usually a separate config file (/etc/php-cli.ini or something like that), which also has to be modified for CLI to load the extension.

Related

Laravel 4.2 on PHP 7.2 with Mcrypt enabled still shows 'Mcrypt PHP extension required.' on browser

I am trying to run a Laravel application (4.2.22) locally with Laravel Homestead 8 that runs on php 7.2 with mcrypt.
I installed mcrypt and enabled it on both php.ini cli and apache2... I have tried everything but my browser still shows "Mcrypt PHP extension required." when I run the application... I was able to even install dependencies (composer install) without showing "mcrypt required"
php -i | grep "mcrypt" shows:
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
php -m shows mcrypt
Is this something that might have to do with Laravel, Composer or some caching?
Checked phpinfo() and noticed the server was using etc/php/7.2/fpm/php.ini I added extension=mcrypt.so to the php.ini file and now it is working on the browser.

php version in plesk - extension installing on wrong version

I've just installed plesk on centos 7, it has multiple php versions installed.
7.1.10 was turned on and was the preferred version to use
However, i've tried to install phplib but it never loads on 7.1.10.
Have installed phplib perfectly fine, yet when you place pdf.so on the php.ini file it never load the extension.
I then noticed that pecl was installing the files in /usr/lib64/php/modules when php claimed they were in /opt/plesk/php/7.1/lib64/php/modules
That got me thinking that it must be installing it on a different php version, so I turned on the default php version of 5.4.16 and what do we have? pdf.so now loads and displays pdflib in the php config page.
Any ideas how to get it working on php 7 under plesk?
I would recommend to do the typical installations steps.
download the current PDFlib package for your Linux (64-bit) PHP and unpack the archive on your server
pick the correct PDFlib PHP DSO for your used PHP version (see bind/php/php-*)
get the correct extension_dir path from your phpinfo() output.
copy the PDFlib PHP DSO to the extension_dir
determine the correct php.ini from the phpinfo() output
add extension=php_pdflib.so to the php.ini
after a restart of your webserver, you should see a "PDFlib" section in the phpinfo() output.
Please see also the PDFlib in PHP Howto or PDFlib 9.1 Tutorial, chapter 2.9 "PHP Binding" for more detailed introduction how to install PDFlib.

curl is not working on php 5.4.3 of wamp server

I am using wamp server that installs php version 5.4.3 and I enabled curl extension, edited php.ini files to uncomment curl extensions lines but the problem is that when I try installing composer using console, it gives me a message that says "PHP Startup: unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll", here is a screenshot of it
I followed instruction from different posts, downloaded curl versions from anindya but with no hope..
Thanks in advance for your time
Make sure your dll is compiled for the version of PHP you're using. So one compiled for 5.5 won't work on 5.4, etc. There's a link in this question that's relevant
PHP cURL not working - WAMP on Windows 7 64 bit
It sounds like you are running a 32bit PHP and have downloaded a 64bit version of PHP_CURL. That wont work
This dll should come as standard with WAMP's PHP's.
Are you sure your problem was not that you forgot that when running PHP in CLI mode you have to configure it using the 'php.ini' file that lives in the c:\wamp\bin\php\php5.4.3\php.ini
So if you uncomment the php_curl extension line in that file it should have worked, until you downloaded the wrong curl dll.
So get a 32bit curl dll for the correct version of php and try again.

Installed DocBlox with Wamp and PEAR

I've been trying to get DocBlox working on windows. I'm running wamp server with PHP version 5.3.9. I've enabled XSL and its showing in phpinfo as well as if I run a test script, XSLTProcessor is available.
I installed DocBlox from PEAR. It runs, however I get the error that the XSL writer was unable to find your XSLTprocessor.
Any ideas? Thank you!
The error that you are receiving means that php does not recognize the xsl extension. Php has got a separate ini file for CLI and web; and I presume that you have enabled the xsl extension for apache only.
You can verify this by executing php -i in your command prompt and check if the xsl extension is enabled there. If not then add your dll to the right config for your WAMP.

PHP Compile Error trying to get mcrypt, Mac OSx 10.6

I and working on setting up a LAMP stack on a new Mac Mini to use as a web server. I am using the bundled PHP version 5.3.3 and Apache 2.2.15.
I have gotten phpMyAdmin working and connect to my mysql installation but I get a "Cannot load mcrypt extension. I did this tutorial - http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/ - to get mcrypt installed and phpinfo() shows mcrypt is installed as per the screenshot at the end.
But im still getting the mcrypt extension not loaded warning. How can I get rid of this. This server is eventually going to be used for production and I would like it to be secure.
Replace extension=mcrypt.so from the tutorial with extension=the/full/path/to/mcrypt.so seems to clear it up.
You may have built mcrypt as i386. Check this with the file command (file mcrypt.so).
Your new Mac mini is 64-bit. Try building mcrypt as x86_64. You could try hacking the Makefile or setting ARCHFLAGS="-arch x86_64".

Categories