I am totally new to laravel. I would like to use it in my project
I downloaded WAMP Stack 7.1.26-2 from http://bitnami.com and to my surprise,it already came with laravel pre-installed.
It is in the frameworks
folder as in: C:\\Bitnami\\wampstack-7.1.26-2\\frameworks
But my problem is that I do not kinow how to use laravel from there.It is not in the htdocs
folder as I think it s supposed to be.
If I go to http://localhost I see only the bitnami welcome page
If i go to http://localhost/laravel ,it says PAGE NOT FOUND
I searched online for the answer but most of the time,it points me to this link: https://docs.bitnami.com/google/apps/#laravel
But on that page, I see NOTHING relating to laravel.I cannot even find the word 'laravel' with a browser search.
If I run composer create-project laravel/laravel myproject --prefer-dist
, I get this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\o.o amoo>composer create-project laravel/laravel myproject --prefer-dist
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-
7.0.0RC7-/php/ext\php_solr.dll' - The specified module could not be found.
in Unknown on line 0
Installing laravel/laravel (v5.5.28)
- Installing laravel/laravel (v5.5.28): Loading from cache
Created project in myproject
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-
7.0.0RC7-/php/ext\php_solr.dll' - The specified module could not be found.
in Unknown on line 0
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 73 installs, 0 updates, 0 removals
- Installing symfony/thanks (v1.1.0): Loading from cache
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Invalid zip file, retrying...
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Invalid zip file, retrying...
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Failed to download symfony/polyfill-ctype from dist: 'C:\Users\o.o amoo\
myproject\vendor/symfony/polyfill-ctype/4199a310f6ba3768faedee6d521ec615' is not a zi
p archive.
Now trying to download from source
- Installing symfony/polyfill-ctype (v1.10.0): Cloning e3d8262452
[RuntimeException]
Failed to clone https://github.com/symfony/polyfill-ctype.git via https, ssh p
rotocols, aborting.
- https://github.com/symfony/polyfill-ctype.git
Cloning into 'C:\Users\o.o amoo\myproject\vendor\symfony\polyfill-ctype'...
fatal: unable to access 'https://github.com/symfony/polyfill-ctype.git/': Fa
iled to connect to github.com port 443: Timed out
- git@github.com:symfony/polyfill-ctype.git
Cloning into 'C:\Users\o.o amoo\myproject\vendor\symfony\polyfill-ctype'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--r
epository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no
-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vc
s] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<dir
ectory>] [<version>]
C:\Users\o.o amoo>
That made me soo confused.It did make a project called myproject
was made in : C:\\Users\\oo amoo> but laravel couldn't be installed???
If I try php artisan serve
I get:
Could not open input file:artisan
So with that,can I access myproject
with laarvel if so,how?If not how come and what do I do?
Someone please point me in the right direction...
Thanks!!!
Alright let's start with why your project is installed in C:/Users it's because you use --prefer-dist in composer create-project laravel/laravel myproject --prefer-dist
.
--prefer-dist: Reverse of --prefer-source, composer will install from dist if possible. This can speed up installs substantially on build servers and other use cases where you typically do not run updates of the vendors. It is also a way to circumvent problems with git if you do not have a proper setup.
Second you run into errors maybe because you are in a directory that require additional rights, at least that's how it looks to me.
If you have installed Laravel correctly you should be able to navigate trough a terminal to the desired location, and either use laravel new
BUT only if you are already in the directory that you want say C:/Code/myproject
if you are still in C/Code
you need to do laravel new myproject
If this doesn't work for you I would suggest you to verify that you installed everything according to the docs
And last but most important I want to mention 1 more thing for you, in Laravel it is really more convinient to use Homestead
. You can read more for what is Homestead, how to install, configure and work with it here : https://laravel.com/docs/5.8/homestead
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.