Composer errors after PHP-FPM downgrade - php

I recently downgraded my PHP-FPM version from 7 to 5.6 by purging nginx and php-fpm and removing the php 7 fpm folder. It went well as my php version is now 5.6.
$ php -v
PHP 5.6.30 (cli) (built: Dec 13 2017 00:40:36)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
My problem is whenever I do a composer install on my project, I get the following errors:
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for behat/behat 3.2.x-dev -> satisfiable by behat/behat[3.2.x-dev].
- behat/behat 3.2.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for behat/behat dev-master -> satisfiable by behat/behat[dev-master].
- behat/behat dev-master requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 3
- Installation request for instaclick/php-webdriver 1.4.5 -> satisfiable by instaclick/php-webdriver[1.4.5].
- instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 4
- behat/behat 3.2.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- behat/symfony2-extension dev-master requires behat/behat ~3.0,>=3.0.4 -> satisfiable by behat/behat[3.2.x-dev].
- Installation request for behat/symfony2-extension dev-master -> satisfiable by behat/symfony2-extension[dev-master].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.1/cli/php.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/15-xml.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-dom.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-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-simplexml.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
- /etc/php/7.1/cli/conf.d/20-wddx.ini
- /etc/php/7.1/cli/conf.d/20-xmlreader.ini
- /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.1/cli/conf.d/20-xsl.ini
As you can see the errors still reference PHP 7 which is really odd considering my PHP version is now 5.6.
Any ideas what might be wrong? Thank you.

move (or remove) your lock file to a tempory name and do a composer update again . This will get rid of old data contained in your lock file and only use the most up to date data from your composer.json
mv composer.lock{,.bak} #move to composer.lock.bak
composer install #installs the project dependencies from the composer.lock file if present, or falls back on the composer.json
As an unrelated note, to make sure you are using the correct php version for your web server, create a web page in your website's root folder containing only :
<?php phpinfo();
as php -v only gives the version of the command line version.

Related

php artisan command not working in ubuntu

When i do php artisan or php artisan serve in my laravel project it shows some error and I don't know how to solve it. I tried removing composer and again installing it also doing composer update but it does not seem to solve the problem.
Operationg System: Ubuntu 20.04 LTS
My Error:
wiggly#Wiggly-Faun:~/Desktop/Web Designing/websites/Ticketing$ php artisan serve
PHP Warning: require(/home/wiggly/Desktop/Web
Designing/websites/Ticketing/vendor/autoload.php): failed to open stream: No such file or
directory in /home/wiggly/Desktop/Web Designing/websites/Ticketing/artisan on line 18
PHP Fatal error: require(): Failed opening required '/home/wiggly/Desktop/Web
Designing/websites/Ticketing/vendor/autoload.php' (include_path='.:/usr/share/php') in
/home/wiggly/Desktop/Web Designing/websites/Ticketing/artisan on line 18
When I do composer install inside my project is shows:
wiggly#Wiggly-Faun:~/Desktop/Web Designing/websites/Ticketing$
composer install
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 v7.18.0 -> satisfiable
by laravel/framework[v7.18.0].
- laravel/framework v7.18.0 requires ext-mbstring * -> the requested
PHP extension mbstring is missing from your system.
Problem 2
- Installation request for league/commonmark 1.5.1 -> satisfiable by
league/commonmark[1.5.1].
- league/commonmark 1.5.1 requires ext-mbstring * -> the requested
PHP extension mbstring is missing from your system.
Problem 3
- Installation request for tijsverkoyen/css-to-inline-styles 2.2.2 -
> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.2].
- tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> the
requested PHP extension dom is missing from your system.
Problem 4
- Installation request for facade/ignition 2.0.7 -> satisfiable by
facade/ignition[2.0.7].
- facade/ignition 2.0.7 requires ext-mbstring * -> the requested PHP
extension mbstring is missing from your system.
Problem 5
- Installation request for phar-io/manifest 1.0.3 -> satisfiable by
phar-io/manifest[1.0.3].
- phar-io/manifest 1.0.3 requires ext-dom * -> the requested PHP
extension dom is missing from your system.
Problem 6
- Installation request for phpunit/php-code-coverage 7.0.10 ->
satisfiable by phpunit/php-code-coverage[7.0.10].
- phpunit/php-code-coverage 7.0.10 requires ext-dom * -> the
requested PHP extension dom is missing from your system.
Problem 7
- Installation request for phpunit/phpunit 8.5.8 -> satisfiable by
phpunit/phpunit[8.5.8].
- phpunit/phpunit 8.5.8 requires ext-dom * -> the requested PHP
extension dom is missing from your system.
Problem 8
- Installation request for scrivo/highlight.php v9.18.1.1 ->
satisfiable by scrivo/highlight.php[v9.18.1.1].
- scrivo/highlight.php v9.18.1.1 requires ext-mbstring * -> the
requested PHP extension mbstring is missing from your system.
Problem 9
- Installation request for theseer/tokenizer 1.1.3 -> satisfiable by
theseer/tokenizer[1.1.3].
- theseer/tokenizer 1.1.3 requires ext-dom * -> the requested PHP
extension dom is missing from your system.
Problem 10
- laravel/framework v7.18.0 requires ext-mbstring * -> the requested
PHP extension mbstring is missing from your system.
- facade/flare-client-php 1.3.2 requires illuminate/pipeline
^5.5|^6.0|^7.0 -> satisfiable by laravel/framework[v7.18.0].
- Installation request for facade/flare-client-php 1.3.2 ->
satisfiable by facade/flare-client-php[1.3.2].
To enable extensions, verify that they are enabled in your .ini
files:
- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are
used by PHP in CLI mode.
Did you installed all the necessary vendor packages locally? Does your "vendor" directory exists?
Don't forget to use:
composer install
in the project directory to install necessary vendor packages.
Also, make sure you have installed necessary PHP extensions, such as mbstring and xml, you may install them via:
sudo apt install php-xml php-mbstring
Hopefullly this helps solve your question.

Unable to install Laravel on Ubuntu 18.10 LEMP stack?

When running laravel new I receive all these errors. I understand what they mean, but I'm curious to why this happenes, on windows it all went through fine.
I installed php, how come Ubuntu throws errors? Does it exclude a lot of things from the php installation? I'm not really sure why its causing so much drama, this is the 10th set of errors I've gone through today and I'm worried I've done something majorly wrong.
I followed this for my LEMP stack: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04
Also, before I can even use the laravel command, I have to run export PATH="~/.composer/vendor/bin:$PATH" every time I open a terminal. Is there a way to fix this?
Problem 1
- Installation request for erusev/parsedown v1.7.2 -> satisfiable by erusev/parsedown[v1.7.2].
- erusev/parsedown v1.7.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for laravel/framework v5.8.7 -> satisfiable by laravel/framework[v5.8.7].
- laravel/framework v5.8.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 3
- Installation request for phar-io/manifest 1.0.3 -> satisfiable by phar-io/manifest[1.0.3].
- phar-io/manifest 1.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 4
- Installation request for phpunit/php-code-coverage 6.1.4 -> satisfiable by phpunit/php-code-coverage[6.1.4].
- phpunit/php-code-coverage 6.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 5
- Installation request for phpunit/phpunit 7.5.7 -> satisfiable by phpunit/phpunit[7.5.7].
- phpunit/phpunit 7.5.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 6
- Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
- theseer/tokenizer 1.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 7
- laravel/framework v5.8.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- beyondcode/laravel-dump-server 1.2.2 requires illuminate/console 5.6.*|5.7.*|5.8.* -> satisfiable by laravel/framework[v5.8.7].
- Installation request for beyondcode/laravel-dump-server 1.2.2 -> satisfiable by beyondcode/laravel-dump-server[1.2.2].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-mbstring.ini
- /etc/php/7.2/cli/conf.d/20-mysqli.ini
- /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
- /etc/php/7.2/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Which PHP version are you using?
You need mbstring extension installed.
Assuming it's PHP7.2, you can install the dependencies required for Laravel like:
sudo apt install php7.2-mbstring php7.2-dom php7.2-pdo php7.2-xml php7.2-common php7.2-bcmath php7.2-json php7.2-cli php7.2-fpm php7.2-mysql
Edit: That LEMP guide doesn't cover php extensions' installation.
Assuimg it's Laravel 5.8, according to the docs, you need some extensions installed, too. Updating my answer accordingly
Note: If you need MySQL etc (because you mentioned LEMP) I've also added php7.2-mysql.
Although, like I mentioned in my comments, I'd prefer Ondrej Sury's PPA and install PHP7.3 and its extensions instead.

composer create-project symfony/website-skeleton my-project

While installing Symfony 4 with website-skeleton option i got this error. I'm using MacOs High Sierra and PHP 7.3.0beta3.
How can i solve this?
Problem 1
- Installation request for facebook/webdriver 1.6.0 -> satisfiable by facebook/webdriver[1.6.0].
- facebook/webdriver 1.6.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
Problem 2
- facebook/webdriver 1.6.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- symfony/panther v0.2.0 requires facebook/webdriver ^1.5 -> satisfiable by facebook/webdriver[1.6.0].
- Installation request for symfony/panther v0.2.0 -> satisfiable by symfony/panther[v0.2.0].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/php5/lib/php.ini
- /usr/local/php5/php.d/10-extension_dir.ini
- /usr/local/php5/php.d/20-extension-opcache.ini
- /usr/local/php5/php.d/40-curl.ini
- /usr/local/php5/php.d/40-openssl.ini
- /usr/local/php5/php.d/50-extension-apcu.ini
- /usr/local/php5/php.d/50-extension-curl.ini
- /usr/local/php5/php.d/50-extension-gmp.ini
- /usr/local/php5/php.d/50-extension-igbinary.ini
- /usr/local/php5/php.d/50-extension-imap.ini
- /usr/local/php5/php.d/50-extension-intl.ini
- /usr/local/php5/php.d/50-extension-mcrypt.ini
- /usr/local/php5/php.d/50-extension-mongodb.ini
- /usr/local/php5/php.d/50-extension-mssql.ini
- /usr/local/php5/php.d/50-extension-pdo_pgsql.ini
- /usr/local/php5/php.d/50-extension-pgsql.ini
- /usr/local/php5/php.d/50-extension-propro.ini
- /usr/local/php5/php.d/50-extension-raphf.ini
- /usr/local/php5/php.d/50-extension-readline.ini
- /usr/local/php5/php.d/50-extension-redis.ini
- /usr/local/php5/php.d/50-extension-xsl.ini
- /usr/local/php5/php.d/99-liip-developer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I solved this by installing pearl following this tutorial
https://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/
then i installed the zip extension by typing sudo pecl install zip

lumen: Your requirements could not be resolved to an installable set of packages

I am a beginner at lumen, which is somewhat based on laravel in php. I tried to create a lumen project using the command.
lumen new blog
and received the following output in my terminal despite the folder being created:
Crafting application...
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 phar-io/manifest 1.0.1 -> satisfiable by phar-io/manifest[1.0.1].
- phar-io/manifest 1.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
- Installation request for phpunit/php-code-coverage 6.0.4 -> satisfiable by phpunit/php-code-coverage[6.0.4].
- phpunit/php-code-coverage 6.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 3
- Installation request for phpunit/phpunit 7.1.5 -> satisfiable by phpunit/phpunit[7.1.5].
- phpunit/phpunit 7.1.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 4
- Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
- theseer/tokenizer 1.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-curl.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-gmp.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-mbstring.ini
- /etc/php/7.2/cli/conf.d/20-mysqli.ini
- /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.2/cli/conf.d/20-pdo_pgsql.ini
- /etc/php/7.2/cli/conf.d/20-pgsql.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
- /etc/php/7.2/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Application ready! Build something amazing.
I've come across similar questions while looking for answers almost none of them have any answers addressing the list of problems being displayed in the terminal despite having the correct version of php. Please help!
As the error message states:
the requested PHP extension dom is missing from your system.
Install and enable the XML extension and you should be good to go.
Certain extensions are missing in your php version . Check out the requirements and install them.

how to configure adminlte with yii2 basic?

I'm using yii2 basic application. what i want is i have to configure adminlte with yii2 basic. So that i have used this composer.
composer require dmstr/yii2-adminlte-asset "2.*"
while running this command in terminal i got the below errors. I don't know what it is.
Problem 1
- yiisoft/yii2 2.0.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for yiisoft/yii2 (locked at 2.0.10, required as ~2.0.5) -> satisfiable by yiisoft/yii2[2.0.10].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.1/cli/php.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-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, reverting ./composer.json to its original content.
Should i install anything. I'm using linux (ubuntu) and php version is 5.6. Can anyone help to figure it out?
First you need to install php mbstring package. Once it is installed and you run composer command, make sure you have added all dependent package in your composer.json otherwise you may have dependencies issues according to your installed packages.

Categories