Symfony install missing vendors libraries - php

I have a fresh install of Symfony with everthing looking in-place apart from my vendors directory is empty? That is, it has
composer and doctrine directories in it but they are empty. If I stand in my root and run the command:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git#github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git#github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
At the front end browsing to http://symfony.local/web/
Warning: require(C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Clearly it's looking for /vendor/autoload.php but this isn't there. Why is my vendor directory empty and how can I ensure the libraries get installed?
$ composer update returns:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git#github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git#github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.

Well, your PHP is not properly configured.
Adjust your /etc/php5/php.ini and enable the "ZIP" extension.
And the rest is probably a permissions issue, because you are using Cygwin in combination with Composer. Composer and Cygwin are not really best friends.
My suggestion: run Composer on the native Windows CLI, just for the vendor fetching part.

What you want is composer update. It will read your composer.json to install all required packages. composer install is used for deployment.

Download and enable the zip extention for PHP
If you are using PHP7.0 and use a debian base distribution (Ex: Ubuntu), use the following to install and enable it automaticaly
apt-get install php-zip

Related

yii2 is not loaded via the composer

You need to install the project, follow the instructions, docker-compose up is successfully completed, however, when executing the docker-compose exec php composer install -o --prefer-dist command, the following message appears:
Loading composer repositories with package information
Installing dependencies (including require-dev) from the lock file
Package operations: 244 installations, 0 updates, 0 deletions
- Installation of yiisoft/yii2-composer (2.0.8): Download (failed)
Download (failed)
Download (failed) Failed to load yiisoft/yii2-composer from disk: "https://api.github.com/repos/yiisoft/yii2-composer/zipball/5c7ca9836cf80b34db265332a7f2f8438eb469b9 " file failed to load: stream failed to open: connection timeout expired
Now I'm trying to download from the source code
I assume that there is a problem with network access, but I do not understand what is the matter
os - ubuntu
environment - phpstorm

Drupal 8 - Unable to upgrade to latest version via composer

My current Drupal Version: 8.7.8. Want to upgrade to 8.8.0.
I already run
composer update
composer prohibits drupal/core:8.8.0
drupal/core 8.8.0 requires typo3/phar-stream-wrapper (^3.1.3)
drupal/drupal - requires typo3/phar-stream-wrapper (^2.1.1)
drupal/core 8.8.0 requires doctrine/annotations (^1.4)
drupal/drupal - does not require doctrine/annotations (but v1.2.7 is installed)
So I run
composer update drupal/core typo/* doctrine/* --with-dependencies
It gives
Package "drupal/core" listed for update is not installed. Ignoring.
Package "typo/*" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
[Composer\Downloader\TransportException]
The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: php_network_getaddresses: geta
ddrinfo failed: nodename nor servname provided, or not known
failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
On
composer outdated drupal/*
It gives
drupal/admin_toolbar 1.27.0 2.0.0 Provides a drop-down menu interface to the core Drupal Toolbar.
So I tried
composer update "drupal/admin_toolbar:^2.0"
Package "drupal/admin_toolbar:^2.0" listed for update is not installed. Ignoring.
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
- The requested package drupal/admin_toolbar (locked at 1.27.0, required as ^2.0) is satisfiable by drupal/admin_toolbar[1.27.0] but these conflict with your requirements or minimum-stability.
I also delete composer.lock file vendor folder & run the composer clearcache then composer install command.
I am not sure what is causing the issue to upgrade.
Look into your composer.json which basic requirements are set.
I think you have some very specific versions where a range would help.
Set new version(range)s explicit from command line or in json (of course save your old file). It's easier to set/update multiple versions in the file than by command line.
Also it might help to use the option --with-dependencies to update multiple packages in one run.
Then you have help with
composer update --dry-run which will tell you what will happen and with
composer why-not <packet>[:<version>] which tells you why a packet (in version ...) can't be installed.
Try deleting your /vendor folder and reinstall.
According to Help docs, there are some new issues that may pop up when upgrading by composer 8.8.0 and above.
Update core via Composer - Drupal.org

Unable to use composer on windows 10

I've installed composer via the exe available on the composer website but when I run «composer install» on my freshly cloned repo, I got this error:
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 84 installs, 0 updates, 0 removals
Installing ocramius/package-versions (1.2.0): Downloading (100%)
Downloading (100%)
Downloading (100%) Failed to download ocramius/package-versions from dist: The "https://codeload.github.com/Ocramius/PackageVersions/legacy.zip/ad8a245decad4897cc6b432743913dad0d69753c" file could not be written to C:\Users\littl\Documents\PhpStorm\interrogator\vendor/ocramius/package-versions/033201643b71b6e284b58c9a7b0d8905: failed to open stream: Permission denied
Now trying to download from source
Installing ocramius/package-versions (1.2.0): Cloning ad8a245dec from cache
[RuntimeException]
Failed to clone https://github.com/Ocramius/PackageVersions.git via https, ssh protocols, aborting.
https://github.com/Ocramius/PackageVersions.git
fatal: destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already
exists and is not an empty directory.
git#github.com:Ocramius/PackageVersions.git
fatal: destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already
exists and is not an empty directory.
I've tried to use composer.phar instead but same issue.
Of course, I've totally removed the vendor directory and started again, same issue.
I've also noticed the «file could not be written» error, but I'm running composer with an Admin account on Win 10 and composer is able to create vendor directory by itself, so it should be good.
What can be the issue ?
destination path 'C:\Users\littl\Documents\PhpStorm\interrogator\vendor\ocramius\package-versions' already exists and is not an empty directory.
Fix this manually.

Error when installing Lumen framework with Composer

When I run
sudo composer global require "laravel/lumen-installer=~1.0"
I get an error (below) that says it failed to download elfet/php-ssh.
Changed current directory to /Users/chad/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing elfet/php-ssh (v1.1.0)
Downloading: Connecting... Failed to download elfet/php-ssh from dist: The "https://api.github.com/repos/elfet/php-ssh/zipball/439becf180272542cbf154df4856a49dd3c4bf04" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
I am meeting all the server requirements too. Any ideas why it's failing to install?
It is a elfet/php-ssh package not found issue and it was resolved
Refer: https://github.com/deployphp/deployer/issues/158
Or you can install lumen via composer create-project and refer the following link has good tutorial about install lumen and create a simple rest api.
link: http://wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel/

Need help to install yii2 application advanced template

I'm new to Yii2, now I'm trying to install yii2 application advanced template.
I did follow these steps:
1 - Download yii2-app-advanced zip file from https://github.com/yiisoft/yii2-app-advanced
2 - Follow GETTING STARTED guide:
+ I'm using Uniform Zero Server (installed in F disk with the path "F:\Server\UniServerZ\www") ok.
+ I creted new folder with name "yii2" in the "www" directory ("F:\Server\UniServerZ\www\yii2")
+ I extracted zip file yii2-app-advanced into "yii2" folder (Every source of yii2-app-advanced now in "yii2" folder so it is the root directory of yii2-app-advanced)
+ Click init.bat file to run "init" and select (0 - Developer mode) and type "yes" to confirm. Done
+ And then I click the yii.bat file, but nothing happened.
+ I tried use this url : localhost/yii2/backend/web/
And I get this Error:
Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\backend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\backend\web\index.php on line 5
or url : localhost/yii2/frontend/web/
And I get this Error too:
Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\frontend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\frontend\web\index.php on line 5
I checked the "vendor" directory follow this path:
F:\Server\UniServerZ\www\yii2\vendor
But it's empty.
So what should I do to fix this error and install yii2 application advanced template?
(My Uniform Server runs PHP5.4)
Yii2 Installation Following command:
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
OR
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo #php "%~dp0composer.phar" %*>composer.bat
C:\Users\username>composer -V
Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
php yii migrate
If you are working on linux, go to the downloaded project and in the terminal type (if you have a composer):
php composer.phar install
If the composer is not installed go to https://getcomposer.org/download/ After this, yii2 framework and other extensions will be installed at vendor directory. This should fix the problem
Install with composer :
D:\wamp\www> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced D:\wamp\www\myyii2app
and run php ./init
D:\wamp\www\myyii2app>php ./init
Under Linux, cd to the directory of the downloadable project using Terminal and run the following commands:
$ php init --env=Development
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar update
Installing using Composer
If you do not have Composer, follow the instructions in the Installing Yii section of the definitive guide to install it.
With Composer installed, you can then install the application using the following commands:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all. The second command installs the advanced application in a directory named yii-application. You can choose a different directory name if you want.
Install from an Archive File
Extract the archive file downloaded from yiiframework.com to a directory named advanced that is directly under the Web root.
Then follow the instructions given in the next subsection.
Preparing application
After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.
Execute the init command and select dev as environment.
php /path/to/yii-application/init
Otherwise, in production execute init in non-interactive mode.
php /path/to/yii-application/init --env=Production --overwrite=All
Create a new database and adjust the components['db'] configuration in common/config/main-local.php accordingly.
Apply migrations with console command yii migrate.
A php component might be missing, i installed mbstring, then restarted the whole process.
yum -y install php54w_mbstring
composer init
composer create-project --prefer-dist
--stability=dev yiisoft/yii2-app-basic <project-name>
****To install YII2-Advance use these command at your CMD. And see bellow...........****
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\admin>e: (RUN COMMAND)
E:>cd xampp/htdocs (RUN COMMAND)
E:\xampp\htdocs>composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application (RUN COMMAND)
Installing yiisoft/yii2-app-advanced (2.0.9)
- Installing yiisoft/yii2-app-advanced (2.0.9)
Loading from cache
Created project in yii-application
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing yiisoft/yii2-composer (2.0.4)
Downloading: 100%
Installing swiftmailer/swiftmailer (v5.4.3)
Downloading: 100%
Installing bower-asset/jquery (2.2.4)
Downloading: 100%
Installing bower-asset/yii2-pjax (v2.0.6)
Downloading: 100%enter code here
Installing bower-asset/punycode (v1.3.2)
Downloading: 100%
Installing bower-asset/jquery.inputmask (3.2.7)
Downloading: 100%
Installing cebe/markdown (1.1.0)
Downloading: 100%
Installing ezyang/htmlpurifier (v4.8.0)
Downloading: 100%
Installing yiisoft/yii2 (2.0.9)
Downloading: 100%
Installing yiisoft/yii2-swiftmailer (2.0.5)
Downloading: 100%
Installing yiisoft/yii2-codeception (2.0.5)
Downloading: 100%
Installing bower-asset/bootstrap (v3.3.7)
Downloading: 100%
Installing yiisoft/yii2-bootstrap (2.0.6)
Downloading: 100%
Installing yiisoft/yii2-debug (2.0.6)
Downloading: 100%
Installing bower-asset/typeahead.js (v0.11.1)
Downloading: 100%
Installing phpspec/php-diff (v1.1.0)
Downloading: 100%
Installing yiisoft/yii2-gii (2.0.5)
Downloading: 100%
Installing fzaninotto/faker (v1.6.0)
Downloading: 100%
Installing yiisoft/yii2-faker (2.0.3)
Downloading: 100%
Writing lock file
Generating autoload files
E:\xampp\htdocs>cd yii-application (RUN COMMAND)
E:\xampp\htdocs\yii-application>php init (RUN COMMAND)
Yii Application Initialization Tool v1.0
Which environment do you want the application to be initialized in?
[0] Development
[1] Production
Your choice [0-1, or "q" to quit] 0 (Enter with 0 RUN COMMAND)
Initialize the application under 'Development' environment? [yes|no] yes (Enter with yes RUN COMMOND)
Start initialization ...
... initialization completed.
E:\xampp\htdocs\yii-application>yii migrate (RUN COMMOND)
Yii Migration Tool (based on Yii v2.0.9)
Creating migration history table "migration"...Done.
Total 1 new migration to be applied:
m130524_201442_init
Apply the above migration? (yes|no) [no]:yes
*** applying m130524_201442_init
create table {{%user}} ... done (time: 0.225s)
*** applied m130524_201442_init (time: 0.310s)
1 migration was applied.
Migrated up successfully.
Finally created yii-application folder in htdocs
E:\xampp\htdocs\yii-application>
If you want to install Yii2 advanced template go to http://www.yiiframework.com/download/ and download the Yii 2 with advanced application template. Once you have extracted the archive file in the www folder.
Then Go to Terminal(For Ubuntu) or cmd(Windows user)
For Ubuntu-
provide root to the extracted folder(advanced) in the Terminal
cd var/www/html/ashish/advanced
Now give the commond- php init
Now advance template is installed properly

Categories