compose update not working if using php8 (xxx in the lock file but not in remote repositories ,...) - composer-php

I've a composer project (magento 2, upgraded from php7 to php 8), if now i use php 8 (inside docker) run "composer udpate", it will shows
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires mobiledetect/mobiledetectlib 2.8.39, found mobiledetect/mobiledetectlib[2.8.39] in the lock file but not in remote repositories, mak e sure you avoid updating this package to keep the one from the lock file.
Problem 2
- Root composer.json requires magento/composer-root-update-plugin 2.0.2 -> satisfiable by magento/composer-root-update-plugin[2.0.2].
- magento/composer-root-update-plugin 2.0.2 requires composer/composer ^1.0 || ^2.0 -> found composer/composer[2.2.18] in the lock file but not in remote reposito ries, make sure you avoid updating this package to keep the one from the lock file.
Problem 3
- Root composer.json requires magento/ece-tools ^2002.1.11 -> satisfiable by magento/ece-tools[2002.1.11, 2002.1.12].
- magento/ece-tools[2002.1.11, ..., 2002.1.12] require colinmollenhour/credis ^1.6.0 -> found colinmollenhour/credis[v1.13.0] in the lock file but not in remote r epositories, make sure you avoid updating this package to keep the one from the lock file.
Problem 4
- Root composer.json requires magento/magento-cloud-metapackage >=2.4.5 <2.4.6 -> satisfiable by magento/magento-cloud-metapackage[2.4.5].
- magento/magento-cloud-metapackage 2.4.5 requires fastly/magento2 ^1.2.34 -> found fastly/magento2[1.2.187] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
But it will work fine in php7.4(inside docker), do anyone know what's the problem?
More info:
docker info
php72:
container_name: web_php
image: webmaketech/php74
build: ./php72
volumes:
- ./src:/var/www
- ./php72/php.ini:/usr/local/etc/php/php.ini
- ./php72/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf
php810:
container_name: web_php_810
image: webmaketech/php810
build: ./php810
volumes:
- ./src:/var/www
- ./php810/php.ini:/usr/local/etc/php/php.ini
- ./php810/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf

You can ignore platform requirements. run the below command.
composer udpate --ignore-platform-reqs

searched 2 days on internet, finally got solution
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
after run this command, i can process now

Related

How to use Mezzio -> Session

I add session and session-ext packages to a Mezzio project.
After that I get an error:
Too few arguments to function Mezzio\Session\SessionMiddleware::__construct(), 0 passed in /var/www/mezzio/vendor/mezzio/mezzio/src/MiddlewareContainer.php on line 57 and exactly 1 expected
I find that mezzio-session uses Zend-session and try to install Zend-session but this gives me an error too:
mezzio/mezzio-session-ext is locked to version 1.12.0 and an update of this package was not requested.
mezzio/mezzio-session 1.6.0 conflicts with zendframework/zend-expressive-session 1.3.0.
mezzio/mezzio-session-ext 1.12.0 requires mezzio/mezzio-session ^1.4 -> satisfiable by mezzio/mezzio-session[1.6.0].
Root composer.json requires zendframework/zend-expressive-session ^1.3 -> satisfiable by zendframework/zend-expressive-session[1.3.0].
How can I use mezzio-session and -session-ext in a Mezzio project?
Update 1:
I get this error on a route where I have used SessionMiddleware::class in the route pipeline as described here:
use Mezzio\Authentication\OAuth2;
use Mezzio\Session\SessionMiddleware;
$app->route('/oauth2/authorize', [
SessionMiddleware::class,
OAuth2\AuthorizationMiddleware::class,
// The following middleware is provided by your application (see below):
App\OAuthAuthorizationMiddleware::class,
OAuth2\AuthorizationHandler::class
], ['GET', 'POST']);

How do I properly create buildspec.yml file for Laravel Application using AWS CodePipeline

I am using AWS CodePipeline for the first time and trying to figure out how to properly create my buildspec.yml file for my Laravel application. There are few resources on the internet.
I have the following in my buildspec.yml file currently:
version: 0.2
phases:
install:
commands:
- curl -s https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- php --version
build:
commands:
- echo Build started on `date`
- echo Installing composer deps
- composer install
- cp extra/.env ./
- php artisan cache:clear
post_build:
commands:
- echo Build completed on `date`
artifacts:
type: zip
files:
- '**/*'
name: clyde-$(date +%Y-%m-%d)
The CodeBuild is successful and this does deploy to Elastic Beanstalk. I did change the configuration in Elastic Beanstalk so the root is /public (for Laravel). However, when I go to the URL, the first line of code run presents an error like below:
View [inc\navbar] not found. (View: /var/app/current/resources/views/layouts/app.blade.php)
This leads me to believe something is not built properly.
To make it work, it will need to use a complete Pipeline: CodeCommit-->CodeBuild-->CodeDeploy
Inside your Artifact bucket there will be two objects generated in the process:
s3://codepipeline-us-east-1-<001122334455>/SourceArtif/
s3://codepipeline-us-east-1-<001122334455>/BuildArtif/
The first one is obtained in the initial phase of the pipeline from CodeCommit.
The second one is created by CodeBuild. The resultant zip file will be exactly the same as that one from CodeCommit. So it seems, the CodeBuild is only testing but not saving the Artifact with results from the instructions specified in buildspec.yml.
The third phase, CodeDeploy will obtain the code from the Artifact and it will need to Build again via scripts referred by appspec.yml.
version: 0.0
os: linux
files:
- source: /
destination: /web/project/html
hooks:
BeforeInstall:
- location: scripts/install_dependencies.sh
timeout: 300
runas: root
AfterInstall:
- location: scripts/build_again.sh
timeout: 600
runas: user
ApplicationStart:
- location: scripts/start_application.sh
timeout: 300
runas: root
The build_again.sh file will need to include same commands you are using in buildspec.yml (build section), then your Laravel project should be working.

Symfony 4 with PHP 7.3 I get Composer update error

I changed my Ubuntu Plesk PHP Version to 7.3.11 to update my Symfony project with composer.
I get the following Error:
- /etc/php/7.3/cli/php.ini
- /etc/php/7.3/cli/conf.d/10-opcache.ini
- /etc/php/7.3/cli/conf.d/10-pdo.ini
- /etc/php/7.3/cli/conf.d/15-xml.ini
- /etc/php/7.3/cli/conf.d/20-calendar.ini
- /etc/php/7.3/cli/conf.d/20-ctype.ini
- /etc/php/7.3/cli/conf.d/20-curl.ini
- /etc/php/7.3/cli/conf.d/20-dom.ini
- /etc/php/7.3/cli/conf.d/20-exif.ini
- /etc/php/7.3/cli/conf.d/20-fileinfo.ini
- /etc/php/7.3/cli/conf.d/20-ftp.ini
- /etc/php/7.3/cli/conf.d/20-gd.ini
- /etc/php/7.3/cli/conf.d/20-gettext.ini
- /etc/php/7.3/cli/conf.d/20-iconv.ini
- /etc/php/7.3/cli/conf.d/20-intl.ini
- /etc/php/7.3/cli/conf.d/20-json.ini
- /etc/php/7.3/cli/conf.d/20-mbstring.ini
- /etc/php/7.3/cli/conf.d/20-phar.ini
- /etc/php/7.3/cli/conf.d/20-posix.ini
- /etc/php/7.3/cli/conf.d/20-readline.ini
- /etc/php/7.3/cli/conf.d/20-shmop.ini
- /etc/php/7.3/cli/conf.d/20-simplexml.ini
- /etc/php/7.3/cli/conf.d/20-sockets.ini
- /etc/php/7.3/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.3/cli/conf.d/20-sysvsem.ini
- /etc/php/7.3/cli/conf.d/20-sysvshm.ini
- /etc/php/7.3/cli/conf.d/20-tokenizer.ini
- /etc/php/7.3/cli/conf.d/20-wddx.ini
- /etc/php/7.3/cli/conf.d/20-xmlreader.ini
- /etc/php/7.3/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.3/cli/conf.d/20-xsl.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I tried to install:
sudo apt-get install php7.3-gd
sudo apt-get install php7.3-intl
sudo apt-get install php7.3-mbstring
Restart with:
sudo service apache2 restart
No change. In my Plesk admin, all the extensions are enabled.
But looks like not from Plesk coming. Comes from the php from server. If I run php --ini I get:
Loaded Configuration File: /etc/php/7.3/cli/php.ini
Scan for additional .ini files in: /etc/php/7.3/cli/conf.d
Additional .ini files parsed: /etc/php/7.3/cli/conf.d/10-opcache.ini,
/etc/php/7.3/cli/conf.d/10-pdo.ini,
/etc/php/7.3/cli/conf.d/15-xml.ini,
/etc/php/7.3/cli/conf.d/20-calendar.ini,
/etc/php/7.3/cli/conf.d/20-ctype.ini,
/etc/php/7.3/cli/conf.d/20-curl.ini,
/etc/php/7.3/cli/conf.d/20-dom.ini,
/etc/php/7.3/cli/conf.d/20-exif.ini,
/etc/php/7.3/cli/conf.d/20-fileinfo.ini,
/etc/php/7.3/cli/conf.d/20-ftp.ini,
/etc/php/7.3/cli/conf.d/20-gd.ini,
/etc/php/7.3/cli/conf.d/20-gettext.ini,
/etc/php/7.3/cli/conf.d/20-iconv.ini,
/etc/php/7.3/cli/conf.d/20-intl.ini,
/etc/php/7.3/cli/conf.d/20-json.ini,
/etc/php/7.3/cli/conf.d/20-mbstring.ini,
/etc/php/7.3/cli/conf.d/20-phar.ini,
/etc/php/7.3/cli/conf.d/20-posix.ini,
/etc/php/7.3/cli/conf.d/20-readline.ini,
/etc/php/7.3/cli/conf.d/20-shmop.ini,
/etc/php/7.3/cli/conf.d/20-simplexml.ini,
/etc/php/7.3/cli/conf.d/20-sockets.ini,
/etc/php/7.3/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.3/cli/conf.d/20-sysvsem.ini,
/etc/php/7.3/cli/conf.d/20-sysvshm.ini,
/etc/php/7.3/cli/conf.d/20-tokenizer.ini,
/etc/php/7.3/cli/conf.d/20-wddx.ini,
/etc/php/7.3/cli/conf.d/20-xmlreader.ini,
/etc/php/7.3/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.3/cli/conf.d/20-xsl.ini
Any idea?
The extension -zip was missing

Laravel composer install error

Hi I create server on Centos 7. i am used php 7 and Httpd server. But when i running composer install am i getting this error. any idea?
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php.ini
- /etc/php.d/20-bz2.ini
- /etc/php.d/20-calendar.ini
- /etc/php.d/20-ctype.ini
- /etc/php.d/20-curl.ini
- /etc/php.d/20-dom.ini
- /etc/php.d/20-exif.ini
- /etc/php.d/20-fileinfo.ini
- /etc/php.d/20-ftp.ini
- /etc/php.d/20-gettext.ini
- /etc/php.d/20-iconv.ini
- /etc/php.d/20-json.ini
- /etc/php.d/20-mysqlnd.ini
- /etc/php.d/20-pdo.ini
- /etc/php.d/20-phar.ini
- /etc/php.d/20-simplexml.ini
- /etc/php.d/20-sockets.ini
- /etc/php.d/20-sqlite3.ini
- /etc/php.d/20-tokenizer.ini
- /etc/php.d/20-xml.ini
- /etc/php.d/20-xmlwriter.ini
- /etc/php.d/20-xsl.ini
- /etc/php.d/20-zip.ini
- /etc/php.d/30-mysqli.ini
- /etc/php.d/30-pdo_mysql.ini
- /etc/php.d/30-pdo_sqlite.ini
- /etc/php.d/30-wddx.ini
- /etc/php.d/30-xmlreader.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Try to install all laravel php requirements first.
You have to install this requirements exactly to php7.
https://laravel.com/docs/5.4/installation

Aurelia, installation issue with webpack

I wanted to try Aurelia today but I have an issue with the webpack skeleton.
So, I have downloaded the webpack skeleton on the official website, and I started the npm install and start script.
But when I browse to http://localhost:9000/ I have a lot of errors.
Html Webpack Plugin:
TypeError: Cannot read property 'request' of undefined
- ExternalModuleFactoryPlugin.js:37 handleExternals
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:37:33
- ExternalModuleFactoryPlugin.js:46 next
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:46:8
- ExternalModuleFactoryPlugin.js:59 handleExternals
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:59:7
- ExternalModuleFactoryPlugin.js:79 ExternalModuleFactoryPlugin.
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:79:5
- NormalModuleFactory.js:177
[aurelia]/[webpack]/lib/NormalModuleFactory.js:177:3
- Tapable.js:123 NormalModuleFactory.applyPluginsAsyncWaterfall
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:123:70
- NormalModuleFactory.js:161 NormalModuleFactory.create
[aurelia]/[webpack]/lib/NormalModuleFactory.js:161:8
- Compilation.js:356 Compilation.process [as _addModuleChain]
[aurelia]/[webpack]/lib/Compilation.js:356:16
- Compilation.js:427 Compilation.process [as addEntry]
[aurelia]/[webpack]/lib/Compilation.js:427:7
- SingleEntryPlugin.js:22 SingleEntryPlugin.
[aurelia]/[config-generate-index-html]/[webpack]/lib/SingleEntryPlugin.js:22 :15
- Tapable.js:156 Compiler.applyPluginsParallel
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:156:14
- Compiler.js:431 Compiler.compile
[aurelia]/[webpack]/lib/Compiler.js:431:7
- Compiler.js:237 Compiler.runAsChild
[aurelia]/[webpack]/lib/Compiler.js:237:7
- compiler.js:70
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/lib/compiler.js :70:19
- compiler.js:69 Object.compileTemplate
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/lib/compiler.js :69:10
- index.js:47 Compiler.
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/index.js:47:40
- Tapable.js:156 Compiler.applyPluginsParallel
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:156:14
- Compiler.js:431 Compiler.compile
[aurelia]/[webpack]/lib/Compiler.js:431:7
- Compiler.js:47 Watching.
[aurelia]/[webpack]/lib/Compiler.js:47:17
I use 2.15.9 npm version and 4.5.0 node version.
Your npm version must be 3 or greater. Update npm using npm install npm -g then install the packages again.

Resources