I cannot access my project in Laravel 5 using Xampp

Asked

Viewed 4,866 times

0

I started studying the Laravel 5 and I was able to install the commiserate and the php framework.

I did some testing after the installation worked perfectly a wonder, I turned off my machine and the next day when I went to study again the framework, I could no longer access what I had already done the day before.

Startei xampp, opened the browser and typed

localhost:8000/exemplo

And he can’t find the project.

Can anyone tell me if I’m doing something wrong or missing some setting in the php.ini?

  • Good evening Bruno, Xampp does not use port 8000, the port in xampp by default is 80, or simply access http://localhost

  • if you had accessed the door 8000 previously, probably vc Avia started the server by PHP itself(Laravel Framework)

  • That’s exactly what I did @Brumazzidb, when installing the framework it already amazed along with xampp.

1 answer

2


Xampp does not use 8000 port by default, the port in xampp (apache) default is port 80, ie just access http://localhost will already work (because port 80 may be omitted from the URL).

Note that to configure Laravel in Apache is a little more complex, however I already answered about this link /a/91799/3635 what to help.

It is likely that the first time you have tried to use PHP Built-in server, in the installation of Laravel comes a file called php server., this file is used for development only, ie the built-in server not fit for production.

If you are in development, just access the folder where the project is located, note that php will have to be in the environment variables, if it is Windows:

  • Open the CMD
  • Type the folder location like this:

    cd c:\Users\Bruno\Meus Documents\Projetos\projeto-em-laravel
    php -S localhost:8000 server.php
    
  • If like-Unix (mac, linux, etc):

    cd /home/Bruno/projeto-em-laravel
    php -S localhost:8000 server.php
    

Then open up http://localhost:8000

Read more on:

Using Artisan

The Artisan is a command line system (CLI) included in the Laravel, which can be customized, you can see all commands running this (in terminal or cmd):

 php artisan list

It is also possible to call the webserver PHP Built-in server using the Artisan:

 php artisan serve

To customize the address and port:

 php artisan serve --host=503.246.895.41 --port=8125
  • Why the downvote? Explain -.-' !!!

  • 1

    I don’t understand either

  • @Guilhermenascimento peeking on the net I found an article that talked about the following command: php artisan serve in my project folder. And I did this and it worked, now out of curiosity I’d like to know. What does this command mean? Why do I have to enter this command to run my project?

  • @Brunoduarte Artisan is a php script to use with CLI, it has a series of commands, basically this you used is a shortcut to the example of my answer, but there are other commands in Artisan, see this: https://laravel.com/docs/master/artisan

  • 1

    Got it @Guilhermenascimento, thanks for the tip. Hug!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.