Installing laravel on mac os via composer - php

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?

Related

Laravel command not found. But it is added to my $PATH on Ubuntu

So I know there are alot of simmular issues but none if them are exactly the same,
I want to start my first laravel project but, my terminal tells me command not found,
I installed composer from the website and when I run composer I can see that it works perfectally with no issue, when running composer global require "laravel/installer" I get this in response :
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
9 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
This tells me that laravel is indeed installed but has not updates but when I run command laravel the response is laravel: command not found,
I have added composer to my $PATH already.
This is why I am posting this issue because all the posts I find says to add composer to your $PATH but mine is already but its still a issue.
PHP is also installed on my machine
I am running linux Ubuntu 22.04 LTS
I'll write the answer here so you can close the question. As #geertjanknapen said in the comment if you can install your project the run
composer create-project laravel/laravel your-app-name
cd /your-app-name
php artisan serve
You must have a local server running also, once you have run php artisan serve then just go to http://127.0.0.1:8000/ and you'll see Laravel's home screen. (NOTE 8000 is the default port, so put yours there if you've changed it).

unable to install Laravel via composer on Windows 7: "29 packages you are using are looking for funding"

I have installed Composer on windows 7 with the Composer-Setup.exe.
I am trying to install Laravel via Composer on Windows 7. I've tried 2 different commands:
composer global require laravel/installer
and
composer create-project laravel/laravel blog --prefer-dist
but they don't work.
In the end, there always a message: "29 packages you are using are looking for funding"
When I type composer fund to find out, it says that:
Composer could not find a composer.json file in C:\Users\Administrators
Does any one have any solution or any useful link?
Your composer.json file have some packages which have paid licence. However composer do not prevent installing Laravel due to this.
As per logs Laravel has been successfully installed. Can you check at the destination folder.

MacOS High Sierra Drush only gives 2 options

So today I was installing Drush via Composer. it was completely installed according to terminal but in /usr/local/bin there is no Drush folder.
I tried before and then I tried with Composer as well, but since that failed I tried via Homebrew but since I work with MAMP, it only gave 2 options (cancel and drush) and yea then I uninstalled that and tried again with composer even did a fresh install.
I did the "composer global show -P" command and It's in /users/mymacname/.composer then it outputs a giant list like:
composer-plugin-api 1.1.0 The Composer Plugin API
so when I go to that location, there is a .composer folder,
when I go in that folder - vendor - bin - there are:
drush
drush.complete.sh
drush.launcher
drush.php
php-parse
psysh
thats all there is and when I type drush, or drush status it gives "-bash: drush: command not found
How can I solve this?
Greetings Ditger
I think you missed the step where you have to add the export to your .bash_profile
export PATH=$PATH:/Users/[username]/drush
this is of course specific to my install, you will have to find where your drush is installed and appropriately add the export path

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

Composer not installing laravel 4 dependencies but working for other for eg twig

I recently tried installing Laravel on my New VPS.
I installed lamp stack and installed composer too.
I tried composer install in laravel directory but it always stuck
showing
Loading composer repositories with package information
Installing dependencies (including require-dev)
I waited almost 30 minutes but it doesn't work.
I am stuck at this point, I tried installing twig using composer in another folder and that worked fine.
my VPS has Ubuntu 12.04 64bit, 256mb ram, PHP 5.3.10 , apache2.2 , git is installed too.
Please let me know what could me the problem
Perhaps try installing Laravel through Composer instead.
composer create-project laravel/laravel
This will do everything you need to get a new Laravel project up and running in one line, which I wrote about as a fast install for Laravel 4.

Categories