i am new to mac os.i have installed laravel in mamp server using manually not using composer.also installed composer but i dont know how to run commands like php artisan and all.
in windows i can easily point to composer like as i given answer to this question
Where and how can I run composer commands?
please help me how to in mamp server ?
thank you in advance
Updated::
Usage:
command [options] [arguments]
Options:
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
--no-interaction (-n) Do not ask any interactive question
--profile Display timing and memory usage information
--working-dir (-d) If specified, use the given directory as working directory.
Available commands:
about Short information about Composer
archive Create an archive of this composer package
browse Opens the package's repository URL or homepage in your browser.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Set config options
create-project Create new project from a package into given directory.
depends Shows which packages depend on the given package
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader
dumpautoload Dumps the autoloader
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
info Show information about packages
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Show information about licenses of dependencies
list Lists commands
remove Removes a package from the require or require-dev
require Adds required packages to your composer.json and installs them
run-script Run the scripts defined in composer.json.
search Search for packages
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Show information about packages
status Show a list of locally modified packages
suggests Show package suggestions
update Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock
CPU664:~ narendrab$ php artisan
Could not open input file: artisan
CPU664:~ narendrab$
In mac os, you can easily install composer globally by
curl -sS https://getcomposer.org/installer | /Applications/MAMP/bin/php5/bin/php
mv composer.phar /usr/local/bin/composer
Then you can just use command composer everywhere without specifying full path. You have to use full path for MAMP php since php comes with mac will be default.
Edit: run artisan command within the project directory.
Related
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).
Maybe just a stupid question.
After I download/clone composer source code from github.com, how can I run it or compile it into a phar file?
When running "php bin/composer -v", it shows such errors:
php bin/composer -v
You must set up the project dependencies using `composer install`
See https://getcomposer.org/download/ for instructions on installing Composer
Is it said that I must download another composer.phar file and run "php composer.phar install" first?
I think it is a recursive way, "composer" itself is managed by composer :(
At first: if someone wants just to use composer, they must not install it from GitHub, just follow the installation guide: https://getcomposer.org/download/
OK, back to the question.
"composer" itself is managed by composer
Yes, and why do you think it is bad?
See the official documentation for contributors. It encourages exactly that way:
Run git clone https://github.com/composer/composer.git
Download the composer.phar executable
Run Composer to get the dependencies: cd composer && php ../composer.phar install
Then you can actually use composer by launching bin/composer, or you can compile it into phar by bin/compile.
If you wonder how are composer binaries actually built, you can see it in their Travis config. They just grab previous composer release provided by Travis, and build new composer release with it.
Composer's job is to locate and install dependencies for a particular project. Everything it does could be done by hand, mostly simply by placing files in the right location, and referencing a series of autoloaders.
In order to build Composer from scratch, you need certain code that is outside of the main Composer repository, such as command-line and logging helpers. You could download all of these manually, but the natural way is to use an existing install of Composer to fetch them.
This is only necessary if you are working on Composer itself, because once you have a successful build, you can produce a PHAR file, which contains all the required code including those third-party dependencies. These are the files distributed as official releases, and are all most people need; the tool even has a self-update command which downloads a new PHAR file and overwrites the one you ran.
This kind of bootstrapping - using an existing build of a tool as part of its own build process - is actually quite common. There are some parts of PHP itself which are generated using a PHP script, and I believe the first feature-complete C++ compiler was written in C++.
I've downloaded a Symfony application and then checked it using php -f ./app/check.php. However, I get:
[ERROR]
Your system is not ready to run Symfony projects
Fix the following mandatory requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Vendor libraries must be installed
> Vendor libraries are missing. Install composer following
> instructions from http://getcomposer.org/. Then run "php
> composer.phar install" to install them.
However, there is no composer.phar file in this application. e.g.
php composer.phar install
Could not open input file: composer.phar
Note: I already have composer installed.
Any suggestions?
The answer is right there in the error message you received.
Install composer following instructions from http://getcomposer.org/
Instead of composer.phar run:
php composer install
I think that's what you need. If you install Composer, then you probably renamed it to composer, and that's the bin you run.
I'm not able to download lavarvel installer using composer 1.2.0 (latest version)
The error received: Failed to open stream: HTTP request failed!
I googled and could not find the answer to fix this to problem.
If possible, someone please try to run this command composer global require "laravel/installer" to check if it works? I think the link to packaglist is no longer valid but I'm not sure.
C:\wamp\www\st>composer self-update -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file C:\Users\Louis\AppData\Local\Temp\composer-cacert-bcf331364fef73d53e4368ba519a6c3fcb21ea7836c3d8efad4ec32731e8152a.pem: valid
Executing command (C:\wamp\www\st): git branch --no-color --no-abbrev -v
Executing command (C:\wamp\www\st): git describe --exact-match --tags
Executing command (C:\wamp\www\st): git log --pretty="%H" -n1 HEAD
Reading C:/Users/Louis/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Louis/AppData/Roaming/Composer/composer.json
Running 1.2.0 (2016-07-19 01:28:52) with PHP 5.5.12 on Windows NT / 6.2
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Downloading https://getcomposer.org/versions
You are already using composer version 1.2.0 (stable channel).
Two ways of laravel install(normally i follow step 1)
step 1.
download zip file from github https://github.com/laravel/laravel
and unzip and put it on wamp/www(where you normally put your project)
wamp>www>folderproject>shift+right click>open command window
here> write on composer composer install
step 2.
go to wamp>www>hold shift and click right mouse ->open command window here->paste composer create-project laravel/laravel in command prompt
then go to laravel project then shift+ right click ,open command window here>write php artisan serve
Config Laravel
• after install laravel then goes to wamp>www>laravelproject
• copy from here .env.example ,and paste it here then .env - Copy.example will create,
• then open sublime ,go to .env - Copy.example file right click and rename to .env and enter
• then goes to wamp>www>laravelproject ,shift+right click ,write php artisan key:generate in command promt
I figured it out this morning. The problem was Kaspersky Internet Security blocked the connection between my PC and packagist.org . I am surprised that it never happened to anyone but me.
*** Solution:
- Disable your antivirus for a momment and run the command installing Laravel.
Thank you all.
Hey i guess you using php 5.5 first upgrade your php version then install use
composer global require "laravel/installer"
if you don't want upgrade your php then
use
composer global require "laravel/installer=~1.1"
I believe your problem is that the config.json-file for Composer has ""packagist": false" inside the file. Try opening the file and changing to : true"
Or run,
cd ~/.composer/vendor/bin
Then
composer global require "laravel/installer"
you can easily first disable your antivirus , then check your version of php that you are using make sure that it is above PHP VERSION 5.5 then open your terminal or cmd then go to directory of composer then paste `composer global require "laravel/installer"
I have developed a cs cart add on, But when I make a zip of it and try to upload it from gui it gives wrong structure data
so after little research I got that, I have to follow some steps of given in following url.
https://github.com/cscart/sdk
But after successful installation of composer, When I run the command
cscart-sdk command:name
It gives me error
cscart-sdk is not recognized as an internal or external command
I am very new to cscart add-on development
There seems to be something wrong with your composer install, please follow this tutorial (this is where cscart also relates to)
Installation - Linux / Unix / OSX#
Downloading the Composer Executable#
Composer offers a convenient installer that you can execute directly from the commandline. Feel free to download this file or review it on GitHub if you wish to know more about the inner workings of the installer. The source is plain PHP.
There are in short, two ways to install Composer. Locally as part of your project, or globally as a system wide executable.
Locally#
Installing Composer locally is a matter of just running the installer in your project directory. See the Download page for instructions.
The installer will just check a few PHP settings and then download composer.phar to your working directory. This file is the Composer binary. It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things.
Now just run php composer.phar in order to run Composer.
You can install Composer to a specific directory by using the --install-dir option and additionally (re)name it as well using the --filename option. When running the installer when following the Download page instructions add the following parameters:
php composer-setup.php --install-dir=bin --filename=composer
Now just run php bin/composer in order to run Composer.
Globally#
You can place the Composer PHAR anywhere you wish. If you put it in a directory that is part of your PATH, you can access it globally. On unixy systems you can even make it executable and invoke it without directly using the php interpreter.
After running the installer following the Download page instructions you can run this to move composer.phar to a directory that is in your path:
mv composer.phar /usr/local/bin/composer
Note: If the above fails due to permissions, you may need to run it again with sudo.
Note: On some versions of OSX the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin.
Note: For information on changing your PATH, please read the Wikipedia article and/or use Google.
Now just run composer in order to run Composer instead of php composer.phar.