I am new to Laravel. I want to composer install the code but I get the error. Does anyone know how to solve it?
Problem 1
- Root composer.json requires php-mime-mail-parser/php-mime-mail-parser ^7.0 -> satisfiable by php-mime-mail-parser/php-mime-mail-parser[7.0.0].
- php-mime-mail-parser/php-mime-mail-parser 7.0.0 requires ext-mailparse * -> it is missing from your system. Install or enable PHP's mailparse extension.
To enable extensions, verify that they are enabled in your .ini files:
- D:\wamp64\bin\php\php7.3.21\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
The mailparse extension does not yet support PHP 7.3 or 7.4.
You need change your PHP version
https://serverpilot.io/docs/how-to-install-the-php-mailparse-extension/
Install Mailparse on PHP 7.0, 7.1, or 7.2
To install this extension on PHP 7.X, SSH in to your server as root and run the following commands:
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl7.X-sp install --nodeps mailparse
sudo bash -c "echo extension=mailparse.so > /etc/php7.X-sp/conf.d/mailparse.ini"
sudo service php7.X-fpm-sp restart
Related
When I run
docker run --rm -v $(pwd):/opt -w /opt laravelsail/php81-composer:latest composer install
to install all the composer dependencies,
these popped up
~/Crowdstage$ docker run --rm -v $(pwd):/opt -w /opt laravelsail/php81-composer:latest composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- spatie/image is locked to version 2.2.2 and an update of this package was not requested.
- spatie/image 2.2.2 requires ext-exif * -> it is missing from your system. Install or enable PHP's exif extension.
Problem 2
- spatie/laravel-medialibrary is locked to version 10.3.4 and an update of this package was not requested.
- spatie/laravel-medialibrary 10.3.4 requires ext-exif * -> it is missing from your system. Install or enable PHP's exif extension.
To enable extensions, verify that they are enabled in your .ini files:
-
- /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
- /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini
- /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
- /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
What is the proper way to set up PHP environment in docker for laravel ?
If I understand correctly, you want to run composer install inside the php container. You can do this by running
docker-compose exec laravel.test "composer install"
if laravel.test is the container name
This is how you can install composer dependencies in a cloned project
docker run --rm -v $(pwd):/opt -w /opt laravelsail/php81-composer:latest composer install --ignore-platform-reqs
hi In Laravel Installation
The following error occurred
user#user-System-Product-Name:/$ composer global require "laravel/installer"
Changed current directory to /home/user/.config/composer
Using version ^2.0 for laravel/installer
./composer.json has been created
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
- laravel/installer v2.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v2.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^2.0 -> satisfiable by laravel/installer[v2.0.0, v2.0.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.1/cli/php.ini
- /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.1/cli/conf.d/10-opcache.ini
- /etc/php/7.1/cli/conf.d/10-pdo.ini
- /etc/php/7.1/cli/conf.d/20-calendar.ini
- /etc/php/7.1/cli/conf.d/20-ctype.ini
- /etc/php/7.1/cli/conf.d/20-exif.ini
- /etc/php/7.1/cli/conf.d/20-fileinfo.ini
- /etc/php/7.1/cli/conf.d/20-ftp.ini
- /etc/php/7.1/cli/conf.d/20-gettext.ini
- /etc/php/7.1/cli/conf.d/20-iconv.ini
- /etc/php/7.1/cli/conf.d/20-json.ini
- /etc/php/7.1/cli/conf.d/20-mcrypt.ini
- /etc/php/7.1/cli/conf.d/20-mysqli.ini
- /etc/php/7.1/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.1/cli/conf.d/20-phar.ini
- /etc/php/7.1/cli/conf.d/20-posix.ini
- /etc/php/7.1/cli/conf.d/20-readline.ini
- /etc/php/7.1/cli/conf.d/20-shmop.ini
- /etc/php/7.1/cli/conf.d/20-sockets.ini
- /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.1/cli/conf.d/20-sysvsem.ini
- /etc/php/7.1/cli/conf.d/20-sysvshm.ini
- /etc/php/7.1/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, deleting ./composer.json.
Installation failed, deleting ./composer.json.
I'm using the latest composer version...
php7 , mysql , apache2 already installed
Just need zip extension:
# For php v7.2
sudo apt-get install php7.2-zip
it says the requested PHP extension zip is missing from your system.
you have to enable or install that.
# For php v7.0
sudo apt-get install php7.0-zip
# For php v7.1
sudo apt-get install php7.1-zip
I worked by previously installing Composer, after php.
Run:
sudo apt-get install php7.2-zip
sudo apt-get install php7.2-curl
The only thing that helped me was updating my PHP to 7.4 with Brew.
brew install php#7.4
Nothing else worked for me.
if you use php 7.3
sudo apt-get install php7.3-curl
or simply if you are not sure with the version, just use code below
sudo apt-get install php7.2-curl
The only thing that helped me was install php-xml
sudo apt-get install php-xml
This is driving me crazy and following all the online tutorials hasn't helped.
I have just upgraded to a new mac running MacOS Sierra (10.12.1) and am trying to get my development environment configured. However, whenever I run composer update or composer install on my project I get the following message:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so, 9): image not found in Unknown on line 0
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.0.35 -> satisfiable by laravel/framework[v5.0.35].
- laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
Problem 2
- laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- tom-lingham/searchy 2.0.10 requires illuminate/support 5.* -> satisfiable by laravel/framework[v5.0.35].
- Installation request for tom-lingham/searchy 2.0.10 -> satisfiable by tom-lingham/searchy[2.0.10].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php.ini
I have run brew install mcrypt and it is already installed.
Warning: mcrypt-2.6.8 already installed
The system is running php 7.1 so I have also run brew install php71-mcrypt
extension=mcrypt.so has been included in the php.ini files, both on my machine and I have tried it inside the vagrant machine.
Any help would be much appreciated as I have been at this for 2 days now!
Since you are running vagrant, you need to install mcrypt within the vagrant machine. check which version of php you have installed on vagrant and install mcrypt using
sudo apt-get install *{mcrypt-version-here}*
restart apache using
sudo service apache2 restart
I had troubles of installing mcrypt-1.0.3 with PHP 7.1 on MacOS 12 Monterey.
~/projects/rest-api php -v
PHP 7.1.33 (cli) (built: Jun 7 2022 17:45:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies
pecl install mcrypt-1.0.3 and pecl install --force mcrypt-1.0.3 failed with next error:
...
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
ERROR: `/private/tmp/pear/temp/mcrypt/configure --with-php-config=/opt/homebrew/opt/php#7.1/bin/php-config --with-mcrypt' failed
But I managed to install it with next command:
pecl install --force mcrypt-1.0.3 <<<"$(ls -d $(brew --prefix)/Cellar/mcrypt/* | tail -1)"
Last lines of result:
...
Build process completed successfully
Installing '/opt/homebrew/Cellar/php#7.1/7.1.33_4/pecl/20160303/mcrypt.so'
install ok: channel://pecl.php.net/mcrypt-1.0.3
Extension mcrypt enabled in php.ini
~/projects/rest-api php -m | grep mcrypt
mcrypt
Please see solution source.
I keep getting this error
Mcrypt PHP extension required
at the bottom after I run a composer update :
Since I am using Mac, I have tried running :
brew search mcrypt
brew install php56-mcrypt
I still get the same error message.
Steps
I solved this by running the following commands
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
php --version // To Test your php
sudo composer update
Result
No more Mcrypt warning !!
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Generating optimized class loader
After update brew:
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
If you have installed php5.6 (or higher), you can use the following command to find out what versions are available in brew:
$ brew search mcrypt
homebrew/php/php53-mcrypt homebrew/php/php55-mcrypt homebrew/php/php70-mcrypt mcrypt
homebrew/php/php54-mcrypt homebrew/php/php56-mcrypt homebrew/php/php71-mcrypt
In my case, I am using php7.0:
$ brew install php70-mcrypt
On macOS High Sierra I did this steps:
1- Search the package:
brew search mcrypt
Result:
==> Searching local taps... homebrew/php/php71-mcrypt mcrypt homebrew/php/php53-mcrypt
homebrew/php/php54-mcrypt homebrew/php/php55-mcrypt
homebrew/php/php56-mcrypt homebrew/php/php70-mcrypt
libtomcrypt
2- Search my php version to know what can I need to install:
php --version
Result:
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS ) Copyright (c)
1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017
Zend Technologies
3- Install the correct package, for me was 7.1.7 => homebrew/php/php71-mcrypt
brew install homebrew/php/php71-mcrypt
4- Find the find "mcrypt.so" extension file
find /usr/ -type f -name "mcrypt.so"
Result:
find:
/usr//local/Cellar/php71-mcrypt/7.1.13_19/mcrypt.so
5- Search the php.ini
php -i | grep 'Configuration File'
Result (if exist):
Configuration File (php.ini) Path => /etc Loaded Configuration File =>
/etc/php.ini
6- Add the next line at the end on /etc/php.ini (see the last step your correct path) the extension mcrypt.so
extension=/usr/local/Cellar/php71-mcrypt/7.1.13_19/mcrypt.so
Finish, you can now execute your command.
You'll need to add the line
extension=mcrypt.so
In your phi.ini file responsible for the CLI PHP version.
To find where it is, run:
php -i | grep 'Configuration File'
In use XAMPP on my Mac, so I had to install php and then compile mcrypt using pecl, after that I copied mcrypt.so to XAMPP.
The actual list of available releases is: http://pecl.php.net/package/mcrypt
The commands was:
echo Install php...
brew install php
/usr/local/opt/php/bin/php -v
echo Correction of "error Connection to `ssl://pecl.php.net:443' failed"...
wget http://curl.haxx.se/ca/cacert.pem
sudo cp cacert.pem /private/etc/ssl/cert.pem
sudo mv cacert.pem /Applications/XAMPP/xamppfiles/share/openssl/cert.pem
/usr/local/opt/php/bin/pecl list-all
echo Compile and Install mcrypt.so...
sudo /usr/local/opt/php/bin/pecl install mcrypt-1.0.1
The last message of build process of pecl was:
Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.7/pecl/20170718/mcrypt.so'
install ok: channel://pecl.php.net/mcrypt-1.0.1
Extension mcrypt enabled in php.ini
Based on path of build process I copied the compiled mcrypt.so to XAMPP and enable the extension on php.ini:
sudo cp /usr/local/Cellar/php/7.2.7/pecl/20170718/mcrypt.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/mcrypt.so
echo 'extension=mcrypt.so' >> /Applications/XAMPP/xamppfiles/etc/php.ini
Check if it works:
/Applications/XAMPP/bin/php -i | grep "mcrypt"
The result have to be:
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
Remember to restart Apache to see it working using browser.
Maybe it helps someone and I win one thumbs up. Thanks
if you using brew try this :
1.Unistall existing php then Install shivammathur/php
add shivammathur php
brew tap shivammathur/php
change php version with you needed (5.6 or 7.2 or 7.4 or 8.1 or next version)
brew install shivammathur/php/php#8.1
2.Install shivammathur/extensions it s will add extension to php
then
brew tap shivammathur/extensions
brew install shivammathur/extensions/mcrypt#8.1
then you install mcrypt with same version as php version
brew install mcrypt#8.1
then restart httpd
brew services restart httpd
Ref :
https://github.com/shivammathur/homebrew-php
https://github.com/shivammathur/homebrew-extensions
I am trying to install laravel via composer ( http://laravel.com/docs/quick#installation ) and I got stuck at the point where it requires Mcrypt extension
Mcrypt PHP extension required.
I installed Mcrypt extension using brew. But still it throws the same requirement error.
I also tried changing the path as suggested here but my which php doesn't show anything other than
/usr/bin/php
Am I doing something wrong with assigning path at ~/.bash_profile? why is "which php" output still the same. and why is mcrypt installation not working on laravel workout?
What command did you use to install mcrypt? It is possible that you try to install the mcrypt extension for the wrong php version.
Try debugging the situation with
php -v
and
ls -al /usr/bin/php
There is a different install recipe for version 5.5 and 5.4 of PHP.
brew install php54-mcrypt
brew install php55-mcrypt
OK, I was fed up off all other solutions which weren't working, so finally downloading and compiling php from source itself worked.
So here's what I did:
Download php from official site
Follow following instructions
cd to/extracted/php/folder
cd /ext/mycript
phpize
./configure
make
make test
sudo make install
Add extension=mcrypt.so to /etc/php.ini file.
Now restart the server
sudo apachectl restart
You are good to go, Cheers! :)