Symfony 4 installation with composer faild - composer-php

When I do sudo composer create-project monolog/monolog Experience2 it succed:
But When I try to install a fresh Symfony 4 application as describe in the official documentation: composer create-project symfony/skeleton Experience2 it faild:
I know about the warning message displayed by composer in fact about the information on composer website according to my understanding, the needed configuration can only be done in composer.json file which one I'll get only after successful istallation then how can I edit it ? since the installation does not succed (therefore there is no file such as ./Experience2/composer.json).

Related

Can not download Laravel UI package

I want to download Laravel UI package via composer and I have got this error
Seems like due to internet issue you can't access packagists site (which composer uses to get the packages) which is causing the installation to fail.
run a fresh composer create-project laravel/laravel command, copy replace your composer.json content with the old projects composer.json. Do the same with .env file
and run composer install. then u can run "composer require/laravel/ui"

any of composer require command not working

I am using Laravel Valet to creating laravel application because suddenly composer "create-project --prefer-dist laravel/laravel blog" not working.
require command not working.
so I install the valet
The composer is successfully installed on my device Globally. i Follow stap from laravel valet doc to setup composer.
Problem is after composer require command it takes minimum 5min to load
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
and nothing happened I wait 30min and not error or no output
check images composer installed
again wait for 1hour no output and no error
one more example
now how to fix it
This looks like a network error. You should check your network settings, double check if you have access. (I think you have because you posted this question)
There could also be something wrong with the installed composer repositories. If one of those is unavailable it will take forever to load all repositories/search for a repository. You can check which repositories are used with the following command:
composer -g config repositories
composer config repositories
It solved. It was my broadband problem. The connection was alright but it was not able to download package. now it's working.

Difference in files laravel install local & on server

When I install laravel on the server via the command:
cd httpdocs/ && /opt/plesk/php/7.1/bin/php /usr/lib64/plesk-9.0/composer.phar create-project laravel/laravel --prefer-dist
I am missing files and folders in the laravel directory, which I would have when I install laravel local on my laptop with the command:
composer create-project laravel/laravel --prefer-dist
The commands are the same, but why am I missing files on the server? Example of a missing file: /app/Http/routes.php and missing folder: /app/events/
In both situations laravel works and shows the default laravel page when I visit the url.
Hope to get a clear answer, I couldn't find it on google or here on stackoverflow.
Just tested this. When using composer create-project, it looks like it will use the maximum version it can while satisfying project requirements.
Therefore, if you're installing using PHP 7.1, it will be able to install the latest, Laravel 5.6. However, if you're running create-project using PHP 5.6, it will only attempt to install Laravel 5.4 since Laravel 5.5 requires PHP 7.0 and 5.6 requires 7.1.
This leads me to believe you don't have a recent version of PHP set up on your local system.

Install Laravel using Composer

I'm trying to install Laravel using Composer, but after running the following command
composer create-project laravel/laravel cmsLaravel 5.2
pointing to my c/xampp/htddocs directory, I get the error below:
C:\xampp\htdocs\laravelCMS\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\laravelCMS\bootstrap\autoload.php on line 17
To install Laravel using composer, all you need to do is to run in your terminal is:
composer create-project --prefer-dist laravel/laravel blog
Where: blog is the name of the folder containing your new Laravel instance.
To install Laravel directly within your chosen directory (not in a folder within it as demonstrated above), simply run the same command but this time without a folder name as in:
composer create-project --prefer-dist laravel/laravel
Remember to run the command within your desired directory for the project; in your case, for C:\xampp\htdocs\, then, run either the first or second command as above base on your needs.
This assumes you already have Composer properly installed as recommended on their website.
Before you try addressing your failed to open stream: error, do avoid having folder names with space(s) as in your command above (obviously not the source of the error).
Make sure you have the correct Server Requirements for Laravel
the failed to open stream: error usually occur when the OpenSSL PHP Extension not enabled.
PHP >= 5.6.4
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
After enabling the required extension(s), do remember to restart your server, then run the following command:
composer update
Follow the steps below;
Download and install Composer.
Go inside the folder C:\xampp\htdocs>(if you are using xampp) or C:\wamp\www>(if you are using wamp) and open cmd/PoweShell & run the following commands:
composer global require "laravel/installer"
composer create-project laravel/laravel (after running this command a folder having name Laravel will be created there)
Now go inside Laravel folder and run php artisan serve command.
After executing the last cmd, it will show an URL: http://127.0.0.1:8000; access the URL in a browser, which should reflect the will see the default webpage of Laravel.
Download and install composer
Run composer global require "laravel/installer"
Open terminal inside C:\xampp\htdocs and run laravel new my_folder_name
You can just run
composer install
and it will process the required files to load the laravel in web browser
EDIT:
After seeing your comment, you should go to your laravel directory in your cmd.
cd C:\xampp\htdocs\laravelCMS
and run the command
composer install
Change your command to this:
composer create-project laravel/laravel cmsLaravel 5.2.*
This mean any sub version of laravel 5.2.
Check your index.php and Change the path as per your project directory
Register The Auto Loader
require __DIR__.'/cmsLaravel /vendor/autoload.php';
$app =require_once __DIR__.'/cmsLaravel /bootstrap/app.php';
composer create-project laravel/laravel 6.0
composer is a tool for dependency management in PHP
create-project is command to create a new laravel project
laravel/laravel is for the skeleton application you get when creating a new project. It provides a default structure that's recommended (you're not forced to use it). The repository contains default config files, controllers, routes, etc. As well as code responsible for bootstrapping the application.
Link Laravel/laravel
6.0 Version in laravel
just run your command line as admin
it worked for me
Please follow this step and try it
step 1
composer create-project laravel/laravel example-app
step 2
composer global require laravel/installer
laravel new example-app
step 3
cd example-app
php artisan serve
Else I will Recommend You To Go in to laravel offical page
Clik Here

Getting Error in installation of yii2 advance template

I'm new to Yii2, I'm trying to install yii2 application advanced template.
I did follow these steps:
1 - Download yii2-app-advanced zip file from https://github.com/yiisoft/yii2-app-advanced
Follow GETTING STARTED guide:
My vendor directory Show Empty.
Please help, thanks in advance
Installing via Composer
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
On Windows, you'll download and run Composer-Setup.exe.
Please refer to the Composer Documentation if you encounter any problems or want to learn more about Composer usage.
If you had Composer already installed before, make sure you use an up to date version. You can update Composer by running composer self-update.
With Composer installed, you can install Yii by running the following commands under a Web-accessible folder:
composer global require "fxp/composer-asset-plugin:~1.0.3"
composer create-project --prefer-dist yiisoft/yii2-app-advanced basic
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all. The second command installs Yii in a directory named basic. You can choose a different directory name if you want.
Note: During the installation Composer may ask for your Github login credentials. This is normal because Composer needs to get enough API rate-limit to retrieve the dependent package information from Github. For more details, please refer to the Composer documentation.
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced basic
Yii2 Installation Following command:
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
OR
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo #php "%~dp0composer.phar" %>composer.bat*
C:\Users\username>composer -V
Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
php yii migrate
Refrence
use composer cos you need composer in future too!
and after unzip the advance project in www or htdocs you should navigate to your project with cmd or terminal and type yii migrate after that again type composer update

Resources