composer-php,packagist , composer create-project - command donot work

composer create-project - command donot work


Tag: composer-php,packagist

I have my project on github containing composer.json in the root directory. This is how my composer.json code looks like:

    "name": "vendor/projectname",
    "description": "My first Composer project",
    "authors": [
            "name": "John Deo",
            "email": "[email protected]"
    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "php": "~5.3"        

I had defined/submited my package on

Now when I try to get the project in my localhost using composer create-project - commands one of its work and another do not work.

1. composer create-project -s dev vendor/projectname  >> WORKS

2. composer create-project vendor/projectname >> DO NOT WORK

Can someone please tell why the second command does not work. What am I missing or doing wrong? Please Help!


You're missing a stable version of vendor/projectname. In git, a tag (without flag) is a stable version and branches are dev versions. So you have to tag a release (e.g. git tag 1.0.0).


WP_UnitTestCase - how to configure the include_path correctly with phpunit PHAR

I'm trying to write a php unit test for my wordpress plugin and have been following the writing-wordpress-plugin-unit-tests tutorial. I've cloned the '' locally I have installed phpunit via the PHAR mechanism as described here : I also have a composer.json configuration [14:11:[email protected]~]$ phpunit --version PHPUnit 4.7.3 by Sebastian...

Travis CI is not case-sensitive by default?

I have a php project that has composer dependencies which are inherently tested in the code path of my unit tests. Here's my sample code: <?php // where FooBar is a composer package but I'm purposely typing it incorrectly here use \fooBaR public function appendNameToWords(array $words, $name) { $start =...

Composer dump-autoload gives preg_match error

I have Composer in my PHP project installed, and want to use the autoloader. On this page I read how the composer.json file should look like and that I should run the command dump-autoload. My composer.json file looks as follows { "require-dev":{ "phpunit/phpunit":"4.5.*", "autoload":{ "psr-0":{ "Yii\\":"yii-1.1.14.f0fee9/" } } } }...

Can't install Composer on Ubuntu behind proxy

I'm trying to install Composer, in order to use Laravel, but I'm behind the company proxy. The proxy is already configured in the system, so wget --proxy-user=<my_user_name> --proxy-password=<my_password> works (curl doesn't!), and I get the 270kB "installer" file. Next, I'm trying to run php installer as the manual says,...

Where to find composer's global packages?

For a plugin for Sublime Text I was required to install a composer package globally. In order to do this I had to run the following command: composer global require "asm89/twig-lint" "@stable" The installation started running and a few seconds later the package was installed. Voila! Well, not really. Step...

Composer scripts

I'm currently developing a package for Laravel 5. Now I wrote an artisan command and I want it to run every time a user installs the package (requires) or runs composer update. So in my composer.json file of the package I have added the scripts section but for some reason...

Running Composer with MAMP: Unable to load dynamic library

I am attempting to get composer running on my Mac and using MAMP. I installed composer using sudo curl -sS | phpmamp So, in .bash_profile, I've added the following alias alias phpmamp='/Applications/MAMP/bin/php/php5.5.14/bin/php' After installing, I also moved composer.phar to /usr/local/bin/composer Now I try to run composer and I get...

Presta Sitemap Bundle Install Error

I have followed the presta sitemap bundle documentation and I am still having issues. I have this line in my composer.json file: "presta/sitemap-bundle": "dev-master" But I get this error: A typo in the package name The package is not available in a stable-enough version according to your minimum-stability setting On...

Behat fails runing after updating dependencies

Just updated composer on a functioning Behat, and now getting the following messages open running behat. PHP Deprecated: "Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Im using Behat-3 ([email protected]). Any advice will be appreciated :)...

Php use a class in the constructor of another class and require it with namespace

I have som legacy code that broke after an update of a dependency class of my ex colleague's Handler class of the Cosenary Instagram Class using composer. The former reference to include the class in the handler class was this: namespace Acme\Instagram; class Handler { /* GOT SOME USEFUL VARS...

Failed installation of zend-escaper with Composer

I'm trying to install zend-escaper but I'm getting this error: This is strange as my PHP version (from phpinfo()) is 5.5.19, the message claims it is 5.3.5(!) which should satisfy the requirement anyway. My ZF version is 1.12.13 I'm using PHP Storm Can anyone help please? Thanks Tomasz...

Composer autoload psr-0 doesn't find class

This is my project structure api | PicoApi | managers | ApiManager.php composer.json index.php This is how my composer looks like: { "autoload": { "psr-0": { "PicoApi\\": "", "PicoApi\\Managers\\" : "managers" } } } This is my index.php: //require Pico Api autoload require 'vendor/autoload.php'; use PicoApi\Managers\ApiManager; try { //initialize the...

using composer to require file shared by multiple sub-directories

I have a GoDaddy shared hosting site. The root folder is html I use this as a testing server so html has several sub-directories like /site1, /site2, /site3. I'd like to install and use the PHP SDK and am following this guide to set it up I have installed...

Composer exit batch file after finish execution

I am trying to do some automation with batch file to perform installing of laravel and then continue with moving files & folder. My batch file looks something like this: @echo off echo Installing laravel... composer create-project laravel/laravel system --prefer-dist echo Laravel installing is done... Now moving files and folder......

Composer: unresolvable dependencies when installing Silex application

I am trying to build a Silex application, with the following requirements requirements Yaml configuration Doctrine ORM Simple User Authorisation my composer.json { "require": { "silex/silex": "~1.2", "symfony/yaml": "2.6.7", "doctrine/dbal": "~2.2", "deralex/yaml-config-service-provider": "1.0.x-dev", "dflydev/doctrine-orm-service-provider": "2.0.*@dev", "jasongrimes/silex-simpleuser": "~1.0" } } When I run composer update, I get the following output Loading...

Error: Class 'Stripe' not found

I'm trying to use the Stripe php api in a Bolt extension but it's having trouble finding the class. I added the Stripe library to composer.json: "require": { "stripe/stripe-php": "1.*" } And ran composer install. myextension/vendor/composer/autoload_classmap.php now shows the classes loaded: $vendorDir = dirname(dirname(__FILE__)); return array( 'Stripe' => $vendorDir ....

Composer: Package that extends another from a fork

I've the following situation: There is package author/package1 on GitHub and Packagist. I decided to fork it into tcb13/package1 to add some code (that will eventually get merged into the original project, however it will take time). Later on, I developed another package, tcb13/package1-extension that extends the fork tcb13/package1 by...

How can I use the new directory structure with Symfony >=2.7?

Before Symfony 2.7 setting the environment variable SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE will trigger the prompt Would you like to use Symfony 3 directory structure? Starting from 2.7 (released yesterday) this doesn't work anymore: composer create-project symfony/framework-standard-edition symfony "2.7.*" Any idea why? I've found a use-new-directory-structure shell arg in composer script handler, how do...

How does Composer know what MediaWiki extensions to load?

We've switched from using Semantic Bundle to install extensions by using Composer. Now we can skip, for some extensions, manually including entry points at the LocalSettings.php file ( But how does MediaWiki know which extensions to load. Does it read composer.json?

Composer update/create-project/install - HTTP Request failed

Recently I learned about Laravel 4.2. Then I switched to Laravel 5. All the time I've used composer to add another dependencies and stuff, I had no problems at all. Last Thursday I've created a new project using composer create-project laravel/laravel dir_name --prefer-dist. All went ok. But since Friday, I...

How to install and use php-pushwoosh on Ubuntu 12.04 LTS linux OS with/without using composer?

I'm a PHP developer by profession. I want to install and use php-pushwoosh on my system running on Ubuntu 12.04 LTS linux OS. For it I went to the link php-pushwoosh website There I come to know about I can install php-pushwoosh by using composer. "The easiest way to install...

Should the vendor folder be in source control?

For instance, files like /vendor/composer/classLoader.php /vendor/composer/autoload_classmap.php On a project I'm on these are checked in. I wasn't sure whether that's good practice or not, as I remember reading Laravel recommends /vendor to be in .gitignore....

drush failing with autoload.php failed to open stream

I searched the whole drupal directory but I didn't find the autoload.php file. I see the error when enabling modules using drush on the command line. Here is the exact error include(sites/all/modules/contrib/guzzle/vendor/autoload.php): failed to open stream: No such file or directory composer_autoload.module:24 [warning] include(): Failed opening 'sites/all/modules/contrib/guzzle/vendor/autoload.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')...

Composer: Require a package with custom namespace

I've been progressively starting to use Composer on my PHP projects, however there's something that I always questioned. For instance, let's say this is my composer.json file: { "require": { "ramsey/uuid": "~2.8" } } I'm telling composer I want the package ramsey/uuid and as expected it download and includes the...

PHPExcel cannot load spreadsheet with formula

When trying to create a reader for a file, I get some strange errors. I was using the dev-master branch, then switched to 1.8.1 but that didn't seem to make any difference therefore I'm thinking it's the spreadsheet that's the problem. There are quite a lot of formulas used in...

`with_dict expects a dict` - Ansible global composer and kosssi.composer

I'm trying to use the kosssi.composer Ansible role to install a global composer instance as well as a couple of composer packages. --- - hosts: myhosts remote_user: vagrant sudo: true roles: - { role: kosssi.composer, composer_path_env: true, composer_home_path: /opt/composer, composer_home_owner: vagrant, composer_home_group: vagrant, composer_global_packages: phpunit/phpunit: '@stable' phing/phing: '@stable' } I've...

Bug in vendor downloaded via composer [closed]

I downloaded some dependencies and there is error in vendor. Where should I fix that error? It's bug in transformation from plural to single. Here's the code I edited in vendor. 'sses' => 'ss', // address 'shes' => 'sh', // switch 'lves' => 'lf', // half 'ses' => 's', //...

Laravel Collection installation with Composer and Laravel 5

I need help with a problem. I'm learning Laravel 5. And I've found a problem trying to do something. I tried to install Laravel Collection. I go to composer.json and I add this line on require: "laravelcollective/html": "5.1.*" But when I execute composer update on shell, I have an error:...

PHP Autoloader doesn't work on Ubuntu production server

I have to environments i'm working developing my API (PHP based): Local development: Mac OS Yosemite - running PHP 5.5.20 Production server: Ubuntu server - running PHP 5.5.9 My code uses composer for auto loading as followed: { "require": { "facebook/php-sdk": "@stable", "everyman/neo4jphp": "dev-master", "predis/predis": "1.0.1", "aws/aws-sdk-php": "2.*" }, "autoload":...

Composer install crashing on Laravel 5 (production only)

I have a very weird issue since yesterday. Running composer install on my production server causes this error... Keep in mind I do not get any error on my local server (Homestead VM). Nothing to install or update Writing lock file Generating autoload files Executing command (CWD): php artisan clear-compiled...

Capistrano Symfony Deploy Failed

I use following configuration for my staging server, I configured this before 2 weeks that was working without any problems. Today I executed and boom it crashed with no detailed explanation about fail point. I have no idea what is going on here. Capfile # Load DSL and set up...

Laravel 4 - Class 'Stripe' not found

I'm trying to install Stripe into my project but I'm having issues. I'm getting the error Class 'Stripe' not found I used composer require stripe/stripe-php and everything installed fine, but I'm still having issues. This is the line that is causing the problem: Stripe::setApiKey(Config::get('stripe.secret_key')); This is my composer.json file: {...

Updating project version: Composer

What's the right way to change version number when using composer? Consider the current scenario: You have master and develop branches and your version is 1.0.0. A critical bug appears and you have to create a hotfix-1.0.1 branch (from master) to fix it and merge back to both master and...

Composer Package Error

I'm not sure what I've done wrong here. I've created a package and I'm trying to require it by using this: composer require "karl-ballard/gravatar" : "1.0.*" However, I keep getting this as an output: InvalidArgumentException Could not find package 1.0.* at any version for your minimum-stability (stable). Check the package...

Laravel installation via composer

When I try and run the following (Mac OS X Yosemite): ↦ composer global require "laravel/installer=~1.1" I get the following error: Changed current directory to /Users/USER/.composer ./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...

Laravel + git, contributers have different enviroment

Me and my coworker are trying to use local git repo for our Laravel project. I am using Ubuntu, with PHP 5.5.9-1ubuntu4.9, and he is using Debian with PHP 5.4.39. When I pulled his commited version, I get an error when trying to run composer update: [email protected]:/var/www/frontend$ composer install Loading...

Laravel Production issue - Updating composer with Laravel 4.1.x

I haven't encountered any issue in deploying my laravel project until now. I've been deploying for like almost a year already for this project. But some new bug came up. First of all. I can't run composer update, cause it says this error. composer update Warning: This development build of...

How to recover destroyed laravel project with composer

I am using laravel 4.2. Today I had to reinstall one of my plugins, and now all my project has been destroyed. here's my composer.json file : { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "laravel/framework": "4.2.*", "barryvdh/laravel-debugbar": "~1.8", "mews/captcha": "dev-master", "prologue/alerts":...

Getting code from my forked repository

I made a fork from a repository called "chrisbjr/api-guard". the repository latest version is v2.2.2, and I made a release v2.2.3 from my fork. I have my own branch which is dev-fulluth, to get the code from my fork not from the main repo, composer has to contain the below... what does it mean when a package has a version number like: 4.4.x-dev?

When browsing the repositories you see packages with these version numbers e.g. If you look at the Phpunit repo There are a few instances 4.5.x-dev 4.3.x-dev 4.2.x-dev Do these packages contain the current work the developers are performing towards basic updates, security and bugfixes etc on an otherwise basically...

Beginner trouble understanding composer and frameworks

im having a really big problem understanding the usage of composer and frameworks. The tutorials i have seen use some kind of online-editor so they dont really help me. I learned about OOP etc and now i want to do the next step and learn about frameworks and composer. I...

Composer package not found in private repository

I'm using Composer to load my private remote repository from BitBucket: { "require": { "pico/pico-core": "dev-dev" }, "repositories": [ { "type": "git", "url": "https://[email protected]/picodevelopmentteam/php-server-core.git" } ], "autoload": { "psr-0": { "PicoApi\\": "" } }, "minimum-stability": "dev" } My pico-core composer.json looks like this: { "name": "pico/pico-core", "require": { "facebook/php-sdk": "@stable",...

Slow response from breaking deployments

It seems that is responding very slowly today. This is breaking deployments that have reasonable timeouts for various steps. Is there a fallback or alternate address?

Composer + Rocketeer + ZF2- Cannot install Rocketeer due to requirements conflict

Can somebody can tell me how to fix this? Rocketeer installs just fine in empty dir, but not along with my existing project, don't know w why. What is requiering that installation? - Installation request for symfony/console == -> satisfiable by symfony/console[v2.6.6]. composer.json { "name": "zendframework/skeleton-application", "description": "Skeleton Application...

How to to install the ircmaxell/password-compat library via Composer

I'm using Symfony2 and I'm working on a login page. I want ot use the bcrypt algorithm, but to do so, I need to install the ircmaxell/password-compat library via Composer. I looked up a couple of site, but I don't understand ANYTHING! I tried reading the Symfony documentation and it...

“PHP Composer” compared with “Ruby Gems and Bundler”

(As first, this question is not "which is better" question. I just want to know how they are similar and differ in functionality perspective.) I'm php developer and currently learning ruby. In these days, many php developers are encouraged to use Composer for dependency management. Before asking questions, I would...

PHP Composer Autoloader Simple Structure

I have Composer working and I'd like to use its autoloader to load my classes, but it's not working. Here's my directory structure. I'm keeping it really simple to start with. index.php composer.json Vendor controllers/webgl.php Inside webgl.php I have: namespace controllers; class webgl { public function lesson1() { } }...

Deleting migrations results in an Exception

In my Application, when I run php artisan migrate:make create_location_user_table, then delete the generated file (doesn't matter if I delete the line created in vendor/composer/autoload_classmap.php, the php artisan migrate:refresh command throws an error: include(<path_to_project>/database/migrations/2015_06_21_105357_create_location_user_table.php): failed to open stream: No such file or directory After running commands to get rid of...

Many DLLs missing when installing composer (windows)

I'm trying to install composer on my computer but I get many errors about missing some DLLs. I've downloaded some of them but I cannot find any website, where to download libsybcomn64.dll. However, I don't think downloading each DLL from internet is a good solution. I'm using Windows 7 x64...

PHP PHARs with composer?

I've been thinking of advantages and disadvantages of distributing my app as a single PHAR. I'd still like to use Composer to manage all the random dependencies I have, though. This means writing back to the phar if stuff changes, which I understand is at best a convoluted process. What's...