0

In anticipation of cold weather I decided to become an opensource contributor. I chose Yii2 project and read the doc.

The steps I have done: 1. create vhost with all necessary php-extensions 2. fork Yii2 repository and clone it on the host 3. add upstream, run composer and npm 4. php build/build dev/app advanced

After 4th step I got the error in console:

PHP Warning 'yii\base\ErrorException' with message 'chdir(): No such file or directory (errno 2)'

in /home/ghopper/Projects/yii2.test/build/controllers/DevController.php:178

It turned out that the script try to execute cd apps/advanced but this folder doesn't exist. So, I created it by myself and it solve the problem.

I stumbled upon "Now you have a working playground for hacking on Yii 2." in the doc, but I think something wrong with my repo.

First of all, I have exactly the same directory structure as it is in original repo. There aren't frontend and backend directories. The second question is about apps/advanced - where should I get it?

Update:

I specified the repo url and get new error:

ghopper@farm /var/www/yii2.test (master) $ php build/build dev/app advanced https://github.com/yiisoft/yii2-app-advanced.git
cloning application repo 'advanced' from 'https://github.com/yiisoft/yii2-app-advanced.git'...
Cloning into '/var/www/yii2.test/apps/advanced'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6293 (delta 2), reused 4 (delta 2), pack-reused 6286
Receiving objects: 100% (6293/6293), 1.32 MiB | 204.00 KiB/s, done.
Resolving deltas: 100% (3389/3389), done.
Checking out files: 100% (270/270), done.
done.
cleaning up application 'advanced' vendor directory...
done.
updating composer for app 'advanced'...
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 66 installs, 0 updates, 0 removals
  - Installing yiisoft/yii2-composer (dev-master f4cb50d): Downloading (100%)         
  - Installing sebastian/version (2.0.1): Downloading (100%)         
  - Installing sebastian/object-reflector (dev-master 7707193): Downloading (100%)         
  - Installing sebastian/recursion-context (dev-master dbe1869): Downloading (100%)         
  - Installing sebastian/object-enumerator (dev-master 06d95dc): Downloading (100%)         
  - Installing sebastian/global-state (dev-master 30367ea): Downloading (100%)    
...
codeception/base suggests installing stecman/symfony-console-
completion (For BASH autocompletion)
codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
Writing lock file
Generating autoload files
done.
linking framework and extensions to 'advanced' app vendor dir...
Removing dir /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2.
Creating symlink for /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2.
Removing dir /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2-gii.
Creating symlink for /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2-gii.
cloning extension repo 'gii' from 'git@github.com:yiisoft/yii2-gii.git'...
Cloning into '/var/www/yii2.test/extensions/gii'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
done.
cleaning up extension 'gii' vendor directory...
done.
updating composer for extension 'gii'...
PHP Warning 'yii\base\ErrorException' with message 'chdir(): No such file or directory (errno 2)'

in /var/www/yii2.test/build/controllers/DevController.php:233

What does it mean git@github.com: Permission denied (publickey).?

GHopper
  • 366
  • 4
  • 15
  • I tried these instructions and didn't have any problems. But if you want to work with framework core, you probably don't need this app - new features and bugfixes should be verified by unit tests anyway, I never need to test something in actual app. – rob006 Sep 29 '18 at 08:13
  • What should I do to get `apps` directory in the repo? It doesn't exist in original repo. Or I don't need this directory at all and the problem is something else? – GHopper Sep 29 '18 at 08:29
  • 1
    Possible duplicate of [GitHub Error Message - Permission denied (publickey)](https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey) – phd Sep 29 '18 at 13:38
  • https://stackoverflow.com/search?q=%5Bgithub%5D+Permission+denied+publickey – phd Sep 29 '18 at 13:38

1 Answers1

0

It isn't true:

fork is URL of your repository fork such as git@github.com:my_nickname/yii2-app-basic.git. If you are core framework contributor you may skip specifying fork.

First of all you have to specify the repository (yii2-app-basic.git or yii2-app-advanced.git)!

The second one - you have to add SSH key to your github.

After that everything works fine and you get the code in apps/advanced directory

GHopper
  • 366
  • 4
  • 15
  • You don't need to specify repository - script will use default repositories if you don't specify anything explicitly. – rob006 Sep 29 '18 at 17:21