After familiar with Codeigniter, I stared to learn Laravel.
I able to install Laravel using following command.
composer create-project --prefer-dist laravel/laravel blog
It works fine. :-)
Next I tried to setup sample Laravel project. I found a sample project from here (https://github.com/evercode1/sample-project).
What I did is I just download it and copied all folders to Xampp htdocs folder.
Then I visit the "http://localhost/sample-project-master/public/".
It gives following error.
Warning:
require(D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Fatal error: require(): Failed opening required
'D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php'
(include_path='D:\xampp\php\PEAR') in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Have I done mistake when setting up already available Laravel project? How I correct following errors or what is the way to import Laravel project?
You should do:
1) Install composer dependencies
composer install
2) An application key need to be generated with the command
php artisan key:generate
3) Open Project in a Code Editor, rename .env.example to .env and modify DB name, username, password to your environment.
4) Migrate the database along with seed
php artisan migrate --seed
5) Now run the artisan serve command
php artisan serve
the first error is due to not getting file path for bootstrap in bootstrap folder .
you should run: composer install
3 . laravel requires vendor libraries which needs to be install , it does not come automatic with the package . because it's is git ignored . so you need to install it if needed.
You should try this
composer install
OR
composer update --no-scripts
composer update
For more details please follow this link.
This means some dependencies are messing,
Open your project root folder and run this command:
composer install
or
php composer.phar install
I believe below command should work as I have tested on Windows and Linux:
composer update --no-scripts
or if you already installed and updated the composer then check below command:
composer global update
first You have to move the project to www(folder) or htdocs if using xamp or any folder that apache load the files from
then open ur terminal or cmd , and cd untill u reach prject folder , or u can do
shift + right click in the folder , a menu will come up choose "open command window here" .
then write this command composer update this will install all the packages u need to run the project .
dont forget to modify .env file with your database information .
this should work .
You are facing this issue because your system might not have composer.laravel need dependency manager.you have to install the first composer to your htdoc folder.
You can install composer using following this command,composer installNow you can install laravel using (must run this command inside your htdoc)composer global require "laravel/installer"
Now you can create project usinglaravel new YOUR_PROJECT_NAME
OR
composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME
Note : it is good if you install composer and laravel on global location.
Documentation Available Here : https://laravel.com/docs/5.4/installation
Related
I want to create new laravel project by composer. I use composer create-project laravel/laravel new-project command for create new project. then, my project is created following this picture.
I start Laravel's local development server using the Laravel's Artisan CLI serve command (first cd new-project and then php artisan serve command). But I got the following error.
Why is there no vendor folder in this project?!!!
How do I fix this error?
(I used PHP 8.1.10)
You need to issue composer install to install packages which creates the vendor/ folder
I want to create a new project using Laravel.
From the documentation, I downloaded Composer using its Windows executable installer.
I have already set the path to: C:\Users\marti\AppData\Roaming\Composer\vendor\bin
**I created the vendor\bin directory
From the command prompt, the command "composer" works.
I tried to install Laravel using the laravel installer and it gives me an error also with the create-project command.
I have tried both methods even with administrative privillages but still there is an error.
Using Laravel Installer:
[ErrorException]
file_put_contents(C:\Users\marti\AppData\Roaming\Composer\vendor\bin): failed to open stream: Permission denied
Using create-project method:
[InvalidArgumentException]
Composer could not find the config file: C:\Users\marti\AppData\Roaming\Composer\vendor\bin
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S
tarted" section
PLEASE HELP!
Error when using laravel installer
Error when using create-project method
I deleted the Composer path variable, changed directory to read "C:>" and ran the command "composer global require laravel/installer"
Try requiring Laravel installer from composer composer global require laravel/installer then simply make a new laravel project laravel new {PROJECT_NAME}
Composer(for windows), as of build v1.10.13 does not require you to manually set then env path variable.
You dont have to change or add anything in the composer installation directory or to environment path variable.
If you have done so, then do the following
Re-install composer.
Run composer in a new cmd window, to see if its is installed properly.
Run composer create-project --prefer-dist laravel/laravel <your project name> and now your project should be set up properly.
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 am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.
I am on a windows 8 machine and I'm trying to learn laravel. I copy and pasted my PHP folder from C:\xampp to C:\php, installed composer, ran composer install then composer create-project laravel/laravel learning-laravel. So far everything was created so I went into the directory and tried to use 'php artisan serve' and got the following error.
C:\Users\denni_000\learning-laravel>php artisan serve
Warning: require(C:\Users\denni_000\learning-laravel\bootstrap/../vendor/autoloa
d.php): failed to open stream: No such file or directory in C:\Users\denni_000\l
earning-laravel\bootstrap\autoload.php on line 17
Why you copied php folder
download composer install it.
download laravel latest version and store it on your xampp/htdocs/laravel
and run cmd with composer install command
For more follow install laravel on windows xampp
or Laravel 4.1 installation with composer in xampp
For windows Simply download Laragon which includes latest php 5.6.7, Apache, Mysql, Redis, Memcached an alternative to Xampp or Mamp with small size. Easy to install laravel and create project with auto create virtual host by it. Thank you.
U need to go to the directory where laravel is installed and run the following command.
composer update
Install Laravel 4.2 with composer:
sudo composer.phar create-project laravel/laravel project-directory-name 4.2 --prefer-dist
Here is a different way to setup laravel, may be you guys will like it
Step 1:
Clone https://github.com/laravel/laravel or you may download zip also.
Step 2:
Navigate to downloaded folder in command prompt and run composer install
Step 3:
open the folder and rename .env.example to .env and update the credentials mentioned in file.
Step 4:
After these steps if you navigate to the directory from web-server it will cause an error No supported encrypter found. The cipher and / or key length are invalid. to fix this just run php artisan key:generate
Done!
Hope you guys like this way :)
You need to install all the laravel required dependency.
To do that, you need to tell composer to install everything needed.
Below is the command to use to install that's required in laravel composer.json.
composer install
Follow the installation guide from Laravel
Install Composer:
Like Laravel.com says: "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system."
Type the following statement in the command line:
composer global require "laravel/installer=~1.1"
Create a fresh Laravel project in a specified directory with the "laravel new" command:
laravel new blog
You can also create a Laravel project using composer, like such:
composer create-project laravel/laravel --prefer-dist
If you want to learn laravel I seriously recommend you use laravel homestead with vagrant.
For this you need to:
Install virtualbox.
Install vagrant.
Install git.
Install ssh.exe (Download msysgit and copy the content of bin folder to git bin folder).
Install Homestead on Vagrant (Follow the steps on laravel/homestead documentation page).
Install Laravel on Homestead (Follow the steps on laravel/installation documentation page).
This method apply to Windows, Linux or Mac, only change the step 4 on linux or mac.