Am trying to create a new laravel project, in the past i have successfully created a new laravel project by running laravel new blog, i just tried it about 2hrs ago and i get this error.
nkossy Desktop $ laravel new blog
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 symfony/thanks v1.0.1 -> satisfiable by symfony/thanks[v1.0.1].
- symfony/thanks v1.0.1 requires composer-plugin-api ^1.1 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Application ready! Build something amazing.
am running Ubuntu 16.04 with php7.1 installation
Running composer update doesn't help
Remove "symphony/thanks" dependency in your project's composer.json plugin and run 'composer update' after.
Here is what I did.
First, uninstall composer, Follow instructions here
then reinstall composer by running the following command.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Lastly run laravel new app, done.
Related
I have an application that I want to install for local development on my laptop with Docker. The application requires libraries from composer.
I would like to avoid installing PHP on my laptop and all necessary extensions just to be able to run composer.
I also don't want to run composer during the build inside of my application container, because I need the vendor folder on my local computer using mount binding.
It looked like the perfect solution to me to install composer though a docker container as explained here:
docker run --rm --interactive --tty \
--volume $PWD:/app \
composer install
However, when doing so, how do you resolve any PHP dependency conflicts?
For example
docker run --rm --interactive --tty \
--volume $PWD:/app \
composer require phpoffice/phpspreadsheet
will fail with
Using version ^1.14 for phpoffice/phpspreadsheet
./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
- phpoffice/phpspreadsheet 1.14.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- phpoffice/phpspreadsheet 1.14.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- Installation request for phpoffice/phpspreadsheet ^1.14 -> satisfiable by phpoffice/phpspreadsheet[1.14.0, 1.14.1].
How can I solve this kind of problems?
When the environment where you are running install, update or require commands is different from the environment where you are going to execute the code, and if you are absolutely certain that these dependencies are going to be met when the code is actually run, you do not need to check them during installation.
Just use --ignore-platform-reqs (docs).
What I usually put in my Dockerfiles when creating images for this kind of project is something like this, the the very minimum:
composer install --ignore-platform-reqs --prefer-dist
The whole thing goes like this if the artefact is being prepared for production:
composer install --ignore-platform-reqs --prefer-dist --no-scripts \
--no-progress --no-suggest --no-interaction --no-dev --no-autoloader
A couple additional steps to dump-autoload and execute post-install scripts are going to be needed in this case.
You do not elaborate how are you planning on running the result of this installation afterwards, so I'm not sure that part will be relevant for you.
Note: this is not particularly "docker" dependant. This strategy would apply any time you are creating an installation on a different machine than were you plan on running the installation.
I want to perform Continuous Integration using Bitbucket Pipelines to build my project.
I first used bitbucket-pipeline.yml file with default configuration as shown below:
image: php:7.1.29
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- vendor/bin/phpunit
After committing and running the test, it failed.
I modified the above configuration with the one below to test the database as well:
image: phpunit/phpunit:6.5.3
pipelines:
default:
- step:
caches:
- composer
script:
- apk add --no-cache php7-gd php7-xmlwriter
- php -r "file_exists('.env') || copy('.env.testing', '.env');"
- composer install
- php artisan key:generate
- php artisan migrate --seed
- vendor/bin/phpunitenter
But when I tried to run it again, it failed. I have now 8 failed builds. Can anyone help to accomplish a successful build?
Testing database or any other 3rd party application should be done using integration Test not unit test, if you're trying to test the database with a unit test it with fail for sure because you're not implemting the proper connection before running the test which should be done only with an integration test.
Also make sure to call bin/phpunit in the right directory, you should cd to the main test directory in laravel and then do ../vendor/bin/phpunit Unit.
This is where the build failed.
The problem was the composer. The composer was successfully installed but failed to run as shown in the datails below:
+ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --
filename=composer
All settings correct for using Composer
Downloading...
Composer (version 1.9.0) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer
+ composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
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
- This package requires php ^7.2 but your PHP version (7.1.29) does not satisfy that
requirement.
Problem 2
- Installation request for moontoast/math 1.1.2 -> satisfiable by
moontoast/math[1.1.2].
- moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is
missing from your system.
Problem 3
- Installation request for sebastian/type 1.1.3 -> satisfiable by
sebastian/type[1.1.3].
- sebastian/type 1.1.3 requires php ^7.2 -> your PHP version (7.1.29) does not
satisfy that requirement.
Problem 4
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.29) does not
satisfy that requirement.
- doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.29) does not
satisfy that requirement.
- Installation request for doctrine/lexer 1.1.0 -> satisfiable by
doctrine/lexer[1.1.0].
Now build succeeded when removed my previous code and tested the "Hello word" string.
as shown below:
echo "Hello world!"
<1s
Build teardown
<1s
Searching for test report files in directories named [test-results, failsafe-reports,
test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.
In Ubuntu 18.04, I have php installed. I confirmed it work with index.php testing. I now try to install composer
composer install
But below error was shown:
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 symfony/routing v4.1.6 -> satisfiable by symfony/routing[v4.1.6].
- don't install symfony/symfony v3.4.17|don't install symfony/routing v4.1.6
- Installation request for symfony/symfony v3.4.17 -> satisfiable by symfony/symfony[v3.4.17].
I have previously install Symfony as a package by
sudo apt install php-symfony
php-symfony is already the newest version (3.4.6+dfsg-1ubuntu0.1).
Do I uninstall symfony and replace it with symfony/routing v4.1.6?
I googled for a long time but I cannot find relevant instructions. Symfony documentation appears to only show instruction on using composer to install Symfony. But I now have trouble to install composer. Please help, thanks!
The symfony/symfony package already includes the Routing component (which you try to install with the symfony/routing package). This is something Composer wrongly allowed in older versions and was fixed in Composer 1.7.3.
Do you really need the Routing component in version 4? If that's the case, you need to remove symfony/symfony first and require all the needed components explicitly if you cannot upgrade all Symfony packages to 4.1.
If you want to install a new Symfony project, I recommend not using the packaged php-symfony and instead use composer to create a new project from scratch. I don't know much about the package, but as you can tell from the version it is outdated (v3.4.18 is the current version). Relying on an outdated package is not recommended. Instead use the recommended way to set up a new project:
composer create-project symfony/skeleton my-project
If you want a full stack application you can also use symfony/website-skeleton as the basis for the project. If you want to stick to the old 3.4 version you can add the constraint to the command:
composer create-project symfony/skeleton:"^3.4"
See also https://symfony.com/doc/current/setup.html
I want install laravel 5.5 on linux ubuntu 16
Run this command .
php version is 7.0
and all Requirements modules are installed
$composer create-project --prefer-dist laravel/laravel blog
And i have error
Installing laravel/laravel (v5.5.28)
- Installing laravel/laravel (v5.5.28)
Loading from cache
Created project in blog
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
- symfony/thanks v1.0.1 requires composer-plugin-api ^1.1 -> no matching package found.
- symfony/thanks v1.0.0 requires composer-plugin-api ^1.1 -> no matching package found.
- Installation request for symfony/thanks ^1.0 -> satisfiable by symfony/thanks[v1.0.0, v1.0.1].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Remove your composer cache first.
run composer clearcache and composer self-update
Hope this helps.
I'm trying to install the FOSUserBundle on Symfony2.
On trying to run this command in the Terminal
composer update friendsofsymfony/user-bundle
I am presented with this error:
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
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from
your system, make sure to have the extension providing it.
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from
your system, make sure to have the extension providing it.
- Installation request for symfony/icu == 1.2.0.0 -> satisfiable by symfony/icu[v1.2.0].
I have read about the INTL extension not being installed correct, so I followed these instructions, restarted MAMP and the issue is still present!
I've checked with phpinfo() also and it's confirmed that INTL has been installed. I'm at a loss on how to get rid of these errors!
The issue is still present because you are running composer update only for FOSUserBundle.
First try to run composer update symfony/icu, and then run composer update friendsofsymfony/user-bundle.
If this doesn't work, try updating all your vendors with composer update