0

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.

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

4 Comments

And how would I point it to C:\wamp64\www? And the installation didn't include shell menus.
or else you can copy that project inside www folder.There is no issue .Working properly
Cheers buddy, that have worked. I don't have the right click menu/user composer here (shell menu). the installer didn't include an option to include shell menus which is what you're referring to. Anyway your updated solution worked. Thanks :)
@user1852196.Glad to hear it helped you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.