Symfony2 error when installing via composer - php

I am trying to install Symfony2 via composer on an Ubuntu server:
php composer.phar create-project symfony/framework-standard-edition /var/www/dev/myproject 2.1.7
but it fails with the following error:
- Installing doctrine/doctrine-bundle (v1.1.0)
Downloading: 100%
rm: cannot remove `/var/www/dev/myproject/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle': Directory not empty
[ErrorException]
ZipArchive::extractTo(): File name too long
Google didn't help, any idea what the problem could be?
Thanks!

try by going inside the directory where you want to install it and then execute
php composer.phar create-project symfony/framework-standard-edition myproject 2.1.7

I guess the problem had to do with the linux server being a VM and the folder I tried to install symfony2 in was a folder shared from windows (the host) ...
After rebooting that error went away (leaving me with lots of random composer errors, but those are not in the scope of this question ;))

Related

Installing PyroCMS error when installing in xampp (windows)

I am getting below error after downloading the package:
**In MigrateCommand.php line 58:
Too few arguments to function Illuminate\Database\Console\Migrations\MigrateCommand::__construct(), 1 passed in C:\xampp\htdocs\pyro\vendor\anomaly\streams-platform\src\Database\Migration\MigrationServiceProvider.php on line 88 and exactly 2 expected**
Above error is generated when entering the command
php artisan install
I had the Same issue! It looks that composer.lock file and your php version are not compatible.
I deleted the composer.lock file that comes with the repo, and the vendor project, after run composer install and then php artisan install.
I hope it works for you!

Missing composer/zend command: development-enable

When I install Zend via composer create-project -n -sdev zendframework/skeleton-application as specified by Zend's main tutorial, I get a skeleton application that seems to work nicely.
However, when I follow this tutorial's advice to use composer development-enable, I get the following message:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "development-enable" is not defined.
Is anyone able to duplicate/fix this problem?
I would normally assume it's an issue with the bash $PATH value, but the composer command by itself runs just fine, so I'm thinking it may be some other problem specific to this subcommand -- a missing dependency somewhere, for example.
Here is the relevant piece of the tutorial I am trying to follow:
https://docs.zendframework.com/tutorials/getting-started/skeleton-application/
(In case it helps for purposes of duplication: The CLI PHP version on my development server is 5.4.43. For reasons I won't bore you with, I can't update this CLI PHP to a newer version; the major release that Apache is using on my machine is 5.6.)
EDIT 1: Rerunning my installation using composer create-project -s dev zendframework/skeleton-application (as specified in the linked tutorial) still results in the same problem.
EDIT 2: Here is my shell input/output.
patrick [~/www/berlin-data]# composer create-project -n -sdev zendframework/skeleton-application
Installing zendframework/skeleton-application (2.3.3)
- Installing zendframework/skeleton-application (2.3.3)
Loading from cache
Created project in /home1/patrick/public_html/berlin-data/skeleton-application
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing zendframework/zendxml (1.0.2)
Loading from cache
- Installing zendframework/zendframework (2.3.3)
Loading from cache
zendframework/zendframework suggests installing doctrine/annotations (Doctrine Annotations >=1.0 for annotation features)
zendframework/zendframework suggests installing ircmaxell/random-lib (Fallback random byte generator for Zend\Math\Rand if OpenSSL/Mcrypt extensions are unavailable)
zendframework/zendframework suggests installing ocramius/proxy-manager (ProxyManager 0.5.* to handle lazy initialization of services)
zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
Writing lock file
Generating autoload files
patrick [~/www/berlin-data]# cd skeleton-application/
patrick [~/www/berlin-data/skeleton-application]# composer development-enable
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "development-enable" is not defined.
When you run the command
composer create-project -n -sdev zendframework/skeleton-application
This will create a directory in your current dir called skeleton-application inside of this directory is where you need to run the command:
composer development-enable
If this still doesnt work then something went wrong with install process.
The first command should give out put something like:
$ composer create-project -n -sdev zendframework/skeleton-application
Installing zendframework/skeleton-application (dev-master 941da45b407e4f09e264f0 00fb537928badb96ed)
- Installing zendframework/skeleton-application (dev-master master)
Cloning master from cache
Created project in C:\Users\<UserName>\Documents\skeleton-application
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing zendframework/zend-component-installer (0.3.0)
Downloading: 100%
- Installing zendframework/zend-stdlib (3.0.1)
Downloading: 100%
...
Notice this line Created project in C:\Users\<UserName>\Documents\skeleton-application
Thats the directory you need to be in to run the command:
cd C:\Users\<UserName>\Documents\skeleton-application
composer development-enable
If that still didnt work, try specifying the version for downloading:
composer create-project -n "zendframework/skeleton-application":"dev-master"
PS
As of writing this the skeleton application requires PHP "^5.6 || ^7.0". So if you are running a lower version composer wont install that copy. And the tutorials based on it may not work as expected.
Two things I've noticed: when you first initialize a skeleton application, depending on your settings, development mode is enabled by default.
If you want to run
composer development-enable
or any other similar commands, you must be in your path/to/install or path/to/yourapp directory for it to work! This is the folder that contains your local composer install. If you are in any of the parent directories, the command will not work.
I was also having this similar problem when trying to enable development mode with the command composer development-enable on my apigility app. I was getting error:
zf-development-mode is not recognised as an internal or external command.
There is a page on the apigility website regarding the development mode module:
https://apigility.org/documentation/modules/zf-development-mode
I found by following the instruction to install the module from composer:
$ composer require zfcampus/zf-development-mode
Then making a copy of the development config file:
$ cp vendor/zfcampus/zf-development-mode/development.config.php.dist config/
Now using the composer development-enable seems to work fine, which in my case returned the message 'Already in development mode'.

Creating a cakephp project using composer and setting the path

I have Composer installed globally, So I open CMD and write the following command to create a project (composer create-project --prefer-dist cakephp/app my_app_name). What this does is install the project in my user folder. I need the project to be installed in wamp/www folder. And I can't for the life of me figure out how to set the path. Should I just cut-paste the project there or will that create issues with cakephp? still new to the framework :)
Any help would be appreciated. Thanks.
Installing CakePHP
Before starting you should make sure that you have got an up to date PHP version:
php -v
You should at least have got installed PHP 5.5.9 (CLI) or higher. Your webserver’s PHP version must also be of 5.5.9 or higher, and should best be the same version your command line interface (CLI) PHP version is of.
Installing Composer
CakePHP uses Composer, a dependency management tool, as the officially supported method for installation.
Installing Composer on Linux and Mac OS X
Run the installer script as described in the official Composer documentation and follow the instructions to install Composer.
Execute the following command to move the composer.phar to a directory that is in your path:
mv composer.phar /usr/local/bin/composer
Installing Composer on Windows
For Windows systems, you can download Composer’s Windows installer here. Further instructions for Composer’s Windows installer can be found within the README here.
Create a CakePHP Project
Now that you’ve downloaded and installed Composer, let’s say you want to create a new CakePHP application into my_app_name folder. For this just run the following composer command:
php composer.phar create-project --prefer-dist cakephp/app my_app_name
Or if Composer is installed globally:
composer self-update && composer create-project --prefer-dist cakephp/app my_app_name
Once Composer finishes downloading the application skeleton and the core CakePHP library, you should have a functioning CakePHP application installed via Composer. Be sure to keep the composer.json and composer.lock files with the rest of your source code.
First point your composer to www folder.In my case i am using Xamp so pointed my composer to htdocs
C:\xampp\htdocs>composer create-project --prefer-dist cakephp/app my_app_name
Installing cakephp/app (3.3.2)
- Installing cakephp/app (3.3.2)
Downloading: 100%
Created project in my_app_name
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Updated
I am using windows .
C:\Users\Vision>cd\
C:\>cd xampp
C:\xampp>cd htdocs
C:\xampp\htdocs>
Also in windows if i right click on inside htdocs any folder i have option to use composer here

Installing laravel on mac os via composer

I need to use lavarel on mac os. I first installed MAMP. After that, following instructions on laravel.com, I installed composer globally via homebrew. Now, when I change my directory to /Applications/ MAMP/htdocs and try composer create-project laravel/laravel myname on the terminal, nothing happens even after half an hour.
I also tried downloading lavarel-master manually,putting the content in htdocs and composer install .Again nothing in .5 hour.
I have done composer self-update and checked composer diag and all is OK.
Upon trying which php ,i get /Applications/MAMP/bin/php/php5.5.10/bin/php
I also restarted mac and tried the commands again,but same result.
Please help ,I am new to php and don't know how to proceed.
PS:Upon trying composer install in laravel master directory the following appears on terminal:
Loading composer repositories with package information
Installing dependencies (including require-dev) and then only the cursor blinks, nothing happening. Is that a trouble with my composer or laravel installation?

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