I am new in Php
and start working on laravel
based project but facing one issue when installing composer
on project level (I am using Phpstrom
Ide).
composer install --no-interaction --ansi Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postInstall > php artisan optimize Script php artisan optimize handling the post-install-cmd event returned with error code 1 Failed to install packages for ./composer.json.
Process :-
- Install composer and wamp server
- Hit this command in order to create laravel project
composer create-project laravel/laravel --prefer-dist
and project is created with this error and no vendor folder is created
Installing laravel/laravel (v5.4.30) - Installing laravel/laravel (v5.4.30): Downloading (100%) Created project in C:\wamp64\www\laravel
php -r "file_exists('.env') || copy('.env.example', '.env');" Script php -r "file_exists('.env') || copy('.env.example', '.env');" handling th e post-root-package-install event returned with error code 1
- I hit the composer command for Install and get first issue in this post
Composer -v
PHP temp directory (D:\mysql\temp) does not exist or is not writable to Composer . Set sys_temp_dir in your php.ini Composer version 1.6.5 2018-05-04 11:44:59
composer -version
PHP temp directory (D:\mysql\temp) does not exist or is not writable to Composer . Set sys_temp_dir in your php.ini
[Symfony\Component\Console\Exception\RuntimeException] The "-e" option does not exist.
Exception trace: () at phar://C:/composer/composer.phar/vendor/symfony/console/Input/ArgvInput.p hp:124 Symfony\Component\Console\Input\ArgvInput->parseShortOptionSet() at phar://C:/c omposer/composer.phar/vendor/symfony/console/Input/ArgvInput.php:105 Symfony\Component\Console\Input\ArgvInput->parseShortOption() at phar://C:/comp oser/composer.phar/vendor/symfony/console/Input/ArgvInput.php:84 Symfony\Component\Console\Input\ArgvInput->parse() at phar://C:/composer/compos er.phar/vendor/symfony/console/Input/Input.php:54 Symfony\Component\Console\Input\Input->bind() at phar://C:/composer/composer.ph ar/vendor/symfony/console/Command/Command.php:200 Symfony\Component\Console\Command\Command->run() at phar://C:/composer/composer .phar/vendor/symfony/console/Application.php:843 Symfony\Component\Console\Application->doRunCommand() at phar://C:/composer/com poser.phar/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->doRun() at phar://C:/composer/composer.p har/src/Composer/Console/Application.php:251 Composer\Console\Application->doRun() at phar://C:/composer/composer.phar/vendo r/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar://C:/composer/composer.pha r/src/Composer/Console/Application.php:100 Composer\Console\Application->run() at phar://C:/composer/composer.phar/bin/com poser:59 require() at C:\composer\composer.phar:24
list [--xml] [--raw] [--format FORMAT] [--] []
composer -v
what's the output? – Renoir Reiscomposer -v
andcomposer -version
output – Nishant DixitD:\mysql\temp
as the setting forsys_temp_dir
. Composer is complaining that it does not have access to that directory or the directory does not exist. – RyanNerd