How to Install CakePHP Console? - cakephp-3.0

I have a CakePHP 3.8 project hosted on github: https://github.com/paultrimor/pecunia
I can successfully clone the project, run composer install & configure app.php to have the application run.
However; the installation does not create a /bin directory, meaning that I cannot use the Console/Shell.
I am looking to install the Console on an existing CakePHP project
I receive the following message when I win composer install and `composer create-project --prefer-source``
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
Updated Security.salt value in config/app.php
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
No Security.salt placeholder to replace.
The first command replaces the "SALT" string to an actual hash in app.php; But, the second command tries to do the same thing, which it cannot.
Any pointers are appreciated. Thanks.

I think you already solved it looking at your repo, but the bin/ folder should be part of your repository. It will not be created with a composer install or composer update command.
If you create a new project using composer create-project cakephp/app --prefer-dist the bin/ executables will be placed. If you don't explicitly ignore it in .gitignore it will be available to all developers.

Step 1 : check PHP Version
php -v
Step 2: Install Composer
step 3: create a new CakePHP application using composer.
composer create-project --prefer-dist cakephp/app projectname
while installing it asking permission for folder just give yes
Set Folder Permissions ? (Default to Y) [Y,n]? Y
it will work.

Related

Composer could not find the config file: C:\composer To initialize a project, please create a composer.json file

I'm trying to install Laravel on my Windows 10, I have set composer in PATH.
The steps that I have executed were:
create a folder called laravel in htdocs folder of xampp C:\xampp\htdocs\Laravel, then I used
cd C:\xampp\htdocs\Laravel
to access this folder then I ran the command
composer create-project laravel/laravel Laravel
While installing, I got this error
[InvalidArgumentException] Composer could not find the config
file: C:\composer
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Try deleting the environment variable. Try Control Panel-->System-->Edit the system environment variables-->Environment variables-->composer-->delete
Then try to create the laravel project normally.

How to run an existing CakePHP project in xamp(localhost)

i have been assigned to a new project with Cake PHP to do some modifications on it, the project already exists and i'm having trouble run it, i don't know how to run the project on my xamp local server, should i download cakePHP in the project( if so, how to do it ?) or there are some commands i should run to get the dependencies of CakePHP and run the application ( if so, what are these commands). thanks in advance.
be sure that your php version >= 5.6.0
you should firstly install composer https://getcomposer.org/download/
then create new project by composer read the manual https://book.cakephp.org/3.0/en/installation.html
Or
- download the full project of Cakephp 3.0 https://github.com/cakephp/cakephp/archive/master.zip
- unzip the archive in /xampp/htdocs/
if you haven't, install composer https://getcomposer.org/download/
git bash into the directory then you can composer update
and all you need to do is go to localhost/

Bitbucket Pipelines config for yii2. Need github token

I am trying to use bitbucket pipelines for my project, and i use simple config:
image: phpunit/phpunit:5.0.3
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- composer --version
- phpunit --version
- composer global require "fxp/composer-asset-plugin:^1.2.0"
- composer install
- php init --env=Development --overwrite=All
But, at composer intall stage, i needs a github token, because yii2 is on github.
So, how to run composer with token, using this config ?
It should be enough to set some configuration for Composer. A link what command(s) to use: API rate limit and OAuth tokens. Simple steps:
Create an account on Github. You will get something like acd276d00a9de5a15743b7a0a33e39c0e7b8aed8. Be sure to make a note as you will not be able to look at it after some time.
Use Composer terminal (Git, for example) and enter command:
composer config -g github-oauth.github.com <oauthtoken>
Where <oauthtoken> is your token.
It should be configured now and Composer should now allow you to install.

Install Laravel 5 on Openshift - gives blank page

I installed Laravel 5 on Openshift via Git. Hitting my app (the clean install) in a browser returns a blank page. Any idea what could be the cause?
Here is the URL: http://dev-rogercreasy.rhcloud.com/
Looks like you have old composer. I had the same error. To fix it go to your php dir and update composer.
In my case I gone to folder where placed my php.exe and ran command composer self-update:
cd d:\work\OpenServer\modules\php\PHP-5.5>D:\work\OpenServer\modules\php\PHP-5.5\
composer self-update
After it I gone back to folder with project and composer install command completed without any errors.
Check out the Laravel 5 QuickStart. The QuickStart uses a custom version of the standard OpenShift PHP 5.4 cartridge. The only difference is the included version of Composer has been updated.

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).