Valet-plus : how to install mcrypt with php7.2 or php7.1 - magento2

Pre-Condition
Magento 2.2.6
Mac Os
Php7.1 or Php7.2
main.CRITICAL: Warning: Use of undefined constant MCRYPT_BLOWFISH -
assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future
version of PHP) in
/Users/Anant/Desktop/Anant/Projects/cheapsheds/vendor/magento/framework/Encryption/Encryptor.php
on line 397 {"exception":"[object] (Exception(code: 0): Warning: Use
of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH'
(this will throw an Error in a future version of PHP) in
/Users/Anant/Desktop/Anant/Projects/cheapsheds/vendor/magento/framework/Encryption/Encryptor.php
on line 397 at
/Users/Anant/Desktop/Anant/Projects/cheapsheds/vendor/magento/framework/App/ErrorHandler.php:61)"}
[]
This is coming due to missing mcrypt module in php so, Can you please know me how i installed it using valet plus

To install mcrypt on Valet Plus, run in Terminal:
brew install mcrypt
pecl install mcrypt
Check it has installed with:
php -m | grep mcrypt

Related

Install mongodb on mac os 10.15 for php7

I have installed mongodb on my mac Catalina 10.15. I have php7.3 version installed as well. Now, I want to use the mongoClient() class with PHP. I tried composer require mongodb/mongodb but it says that the mongodb extension is missing :
Using version ^1.5 for mongodb/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- mongodb/mongodb 1.5.1 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.5.0 requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system.
- Installation request for mongodb/mongodb ^1.5 -> satisfiable by mongodb/mongodb[1.5.0, 1.5.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
So I tried to install the extension for php using the php doc and I get this error :
pear/install/mongodb/php_phongo.c -fno-common -DPIC -o .libs/php_phongo.o
/private/tmp/pear/install/mongodb/php_phongo.c:22:10: fatal error: 'php.h' file not found
#include <php.h>
^~~~~~~
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed
Any help ?
I also had the same issue after upgrading to MacOS Catalina
Run these two commands;
brew doctor
brew link --overwrite php
I fixed that by installing PHP7.3 using homebrew
here is a post that helped Install PHP 7.3 + xdebug on MacOS Catalina (with homebrew)
I also updated the macos to 10.15 catalina and started the setup. As same as error came during installing the mongodb driver
After Resolving my issue I updated the answer by given below steps:
Step 1:
Run the command: brew install php71
Step 2:
Edit httpd.conf under directory of /etc/apache2/httpd.conf
Add below line
LoadModule php7_module /usr/local/opt/php#7.1/lib/httpd/modules/libphp7.so
then check there should be no other php7_module enabled.
Also add these lines
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Step 3: Restart apache: sudo apachectl restart
Step 4:
If you need to have php#7.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/php#7.1/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.1/sbin:$PATH"' >> ~/.bash_profile
For compilers to find php#7.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/php#7.1/lib"
export CPPFLAGS="-I/usr/local/opt/php#7.1/include"
Step 5:
To have launched start php#7.1 now and restart at login:
brew services start php#7.1
Step 6:
Open new terminal & check php version & it should be 7.1
Step 7:
Then run the command: sudo pecl install MongoDB
& it will install php mongodb driver successfully without any error.
Make sure all step should be followed!!
I did these steps to resolve my MongoDB driver issue for laravel project which not found.

unable to update to Ruby 2.1.4

Currently running Yosemite and unable to update to ruby 2.1.4 , see below.
Guidos-MacBook-Pro:~ Guido$ rvm install 2.1.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.1.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0
ERROR: '/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.
So after I stepped away from the computer for a few hours and came back again, I figured out the issue was that Homebrew was broken after I updated OS to Yosemite. Here is the link http://ryantvenge.com/2014/09/ruby-homebrea-yosemite/ to the solution. If that is not working see commands below.
To fix Homebrew:
cd /System/Library/Frameworks/Ruby.framework/Versions
sudo ln -s Current 1.8
brew update
sudo rm 1.8
To update to ruby 2.1.4:
rvm install 2.1.4
rvm use 2.1.4

installing ruby 1.9.3 in michael hartl's ruby on rails tutorial

I'm working on Michael Hartl's ruby on rails tutorial http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec-development_tools.
I installed Git, updated my OS to 10.8.2 and downloaded XCode 4.5.2.
when I type in
rvm install 1.9.3
this long thing comes up...
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.8.2, Xcode 4.5.2.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
Xcode and gcc:
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.
Xcode 4.1 and earlier:
- Ruby will build fine.
Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
* Install apple-gcc42 from Homebrew
* Install osx-gcc-installer
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
Xcode 4.2+ install or/and Command Line Tools for Xcode is required to provide make and other tools.
osx-gcc-installer:
If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer.
Warning: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire.
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.
Press 'q' to continue.
~
(END)
Originally I had to get homebrew and
brew install libksba
but I did that already and it works. That leads to "Xcode and gcc:" and everything below it.
So, I have homebrew, and the following three commands work:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
But when I try
rvm pkg install openssl
this is what happens
Fetching openssl-1.0.1c.tar.gz to /Users/adamzerner/.rvm/archives
Extracting openssl to /Users/adamzerner/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Compiling openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/adamzerner/.rvm/log/openssl/make.log
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates
Error running 'update_openssl_certs', please read /Users/adamzerner/.rvm/log/openssl.certs.log
And this is what happens when I try what it says...
Adam-Zerners-MacBook-Pro:~ adamzerner$ rvm reinstall all --force
Adam-Zerners-MacBook-Pro:~ adamzerner$
some other information...
I don't see a .rvm folder under adamzerner, so I can't read what it tells me to (not that I would understand what I'd be reading anyway).
It seems that I have 1.8.7 installed:
Adam-Zerners-MacBook-Pro:~ adamzerner$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
So... to summarize... when I try to run
rvm install 1.9.3
I get the gcc/Xcode problem. To fix that it says to download apple-gcc42 from Homebrew. When I do that, I get a problem after doing
rvm pkg install openssl
The problem being that I need to reinstall all rubies. When I do that:
rvm reinstall all --force
it seems that nothing happens.
Thanks in advance to anyone willing to help me with this problem!
EDIT: I forgot to say this before. For the "long thing" up above, when I press q to continue, this is what happens...
Searching for binary rubies, this might take some time.
https://rvm.io/binaries/osx/10.8/x86_64/ruby-1.9.3-p327.tar.bz2 - #configure
ruby-1.9.3-p327 - #download
ruby-1.9.3-p327 - #extract
ruby-1.9.3-p327 - #validate
Libraries missing for ruby-1.9.3-p327: env. Refer to your system manual for installing libraries
Mounting remote ruby failed, trying to compile.
Fetching yaml-0.1.4.tar.gz to /Users/adamzerner/.rvm/archives
Extracting yaml to /Users/adamzerner/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/make.log
Installing Ruby from source to: /Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracted to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327 (already extracted)
ruby-1.9.3-p327 - #configuring
Error running './configure --enable-shared --disable-install-doc --prefix=/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
EDIT: What happens when I follow the github link OliverAtkinson posted
Last login: Wed Dec 26 15:55:12 on ttys000
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew update
Updated Homebrew from 751a0d6e to c67c126c.
==> New Formulae
ume
==> Updated Formulae
akka global markdown ruby slrn
basex gnuplot mu ruby-build ttytter
casperjs gradle qt shiboken vice
cassandra groonga qt5 shocco wine
discount jenkins rakudo-star signing-party xvid
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew tap homebrew/dupes
Error: Already tapped!
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew install autoconf automake apple-gcc42
Error: autoconf-2.69 already installed
Error: automake-1.12.6 already installed
Error: apple-gcc42-4.2.1-5666.3 already installed
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew remove autoconf automake apple-gcc42
Uninstalling /usr/local/Cellar/autoconf/2.69...
Uninstalling /usr/local/Cellar/automake/1.12.6...
Uninstalling /usr/local/Cellar/apple-gcc42/4.2.1-5666.3...
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew install autoconf automake apple-gcc42
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
Already downloaded: /Library/Caches/Homebrew/autoconf-2.69.tar.gz
==> Patching
patching file bin/autoreconf.in
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69
==> make install
/usr/local/Cellar/autoconf/2.69: 69 files, 2.0M, built in 13 seconds
==> Downloading http://ftpmirror.gnu.org/automake/automake-1.12.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/automake-1.12.6.tar.gz
==> ./configure --prefix=/usr/local/Cellar/automake/1.12.6
==> make install
/usr/local/Cellar/automake/1.12.6: 130 files, 2.1M, built in 16 seconds
==> Downloading http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
Already downloaded: /Library/Caches/Homebrew/apple-gcc42-4.2.1-5666.3.pkg
==> Caveats
NOTE:
This formula provides components that were removed from XCode in the 4.2
release. There is no reason to install this formula if you are using a
version of XCode prior to 4.2.
This formula contains compilers built from Apple's GCC sources, build
5666.3, available from:
http://opensource.apple.com/tarballs/gcc
All compilers have a `-4.2` suffix. A GFortran compiler is also included.
==> Summary
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M, built in 5 seconds
Adam-Zerners-MacBook-Pro:~ adamzerner$ rvm pkg install openssl
Fetching openssl-1.0.1c.tar.gz to /Users/adamzerner/.rvm/archives
Extracting openssl to /Users/adamzerner/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Compiling openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/adamzerner/.rvm/log/openssl/make.log
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates
Error running 'update_openssl_certs', please read /Users/adamzerner/.rvm/log/openssl.certs.log
Adam-Zerners-MacBook-Pro:~ adamzerner$ CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.9.3 --patch falcon --force-autoconf -j 3
Removing /Users/adamzerner/.rvm/src/ruby-1.9.3-p327...
/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 has already been removed.
Fetching yaml-0.1.4.tar.gz to /Users/adamzerner/.rvm/archives
Extracting yaml to /Users/adamzerner/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running 'make -j3', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/make.log
Installing Ruby from source to: /Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracting ruby-1.9.3-p327 to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327
ruby-1.9.3-p327 - #extracted to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327
Applying patch /Users/adamzerner/.rvm/patches/ruby/1.9.3/p327/falcon.diff
ruby-1.9.3-p327 - #autoreconf-f
ruby-1.9.3-p327 - #configuring
Error running './configure --enable-shared --disable-install-doc --prefix=/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
Adam-Zerners-MacBook-Pro:~ adamzerner$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Adam-Zerners-MacBook-Pro:~ adamzerner$
I've successfully downloaded Ruby 1.9.3 now!
I think the problem was that I hadn't downloaded Command Line Tools from XCode. See http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
note that for whoami, it's using the backtick key, which is right above the tab key. It is NOT using quotes.
After I downloaded Command Line Tools, I then typed in rvm install 1.9.3. I got the same "long thing" as before, but at that point I had everything I needed, so I just pressed q to continue, and ruby 1.9.3 was successfully installed!
note: although it was successfully installed, when I typed ruby -v, it still said it was 1.8.7 even though it wasn't. However, after closing and reopening the terminal, it then said that the version was indeed 1.9.3.

imagick and mongo on OSX lion with brew

I am trying to install imagick and mongo on osx lion. Note that my php installation is done via homebrew. I have installed the packages correctly and it should work but php returns the following
Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
Any clues on how to fix that?
The PHP errors indicate that you've compiled extensions for a different API version (20090626 API is PHP 5.3) from the server you are trying to use the extensions with (20100525 API is PHP 5.4).
I suspect that you have installed PHP 5.4 via homebrew, but managed to pick up the OS X default headers (PHP 5.3) when compiling the extensions. You need to either recompile your extensions with PHP 5.4, or downgrade your web server to PHP 5.3.
You can check the version of PHP headers in your path using php-config:
php-config --version
And the version of PHP and extension API with:
php -i | egrep "PHP (Extension|Version)"
Possible fixes:
Include /usr/local/bin in your path first so the homebrew PHP versions are found in preference to the system default:
export PATH=/usr/local/bin:$PATH
Install PHP 5.3 via Homebrew:
brew uninstall php54
brew install php53
For reference, I'd like to add that
when brew installs php it sets the additional ini files read folder to
/usr/local/etc/php/5.4/php5/conf.d
whilst it actually is
/usr/local/etc/php/5.4/conf.d
you can easily fix that by symlinking
cd /usr/local/etc/php/5.4/
mkdir php5
cd php5
ln -s ../conf.d .

PHP :mbstring module install

I have tried to install the mbstring module for PHP. I have entered the below commands:
yum install php-mbstring
/usr/local/apache/bin/apachectl restart
Module is now installed but the errors has not dissapeared.
Fatal error: Call to undefined function mb_send_mail()
In my phpinfo(), "mbstring" doesn't exist...
OS: centos 6
PHP: 5.3.8
How did you install PHP on your system? The PHP version currently supported via YUM install is 5.3.3, but you said your PHP version is 5.3.8 which leads me to believe that you may have compiled PHP manually. If so, you will have to recompile with the --enable-mbstring flag.