Xampp does not load project laravel

1

I have the project laravel on a mac with OSX the captain with php artisan . The project runs without problem, but for personal reasons I want to use the apache of xampp instead of artisan server then when I try to load the index.blade.php instead of loading the view this appears.

Perform the same procedure but on a PC with Windows 7 and the XAMPP load without any problem my App is not for what reason on the Mac does not run any ideas?

the url I'm trying to access is

  

link

the route.php file is as follows:

<?php

/*
*/

Route::get('/', function () {
    return view('welcome');
});

/*
Route::get('crearusuario',function(){
  return "URL crearusuarioasdadasd";
});
*/

//carpeta dentro de VISTAS almacen
Route::resource('almacen/categoria','CategoriaController');

The funny thing is that when I try to simply access localhost with the xampp instead of loading the welcome from laravel the following appears:

    
asked by jeancarlos733 10.10.2016 в 06:08
source

3 answers

3

1.- You are accessing the wrong path. To be able to access laravel, you must go to the public folder where it will load everything.

http://localhost/sisVentas/public

2.- Another option is to configure the virtual hosts of your Xampp so that you can access those projects in an easier way. To do that, it's very simple

Configure windows host

  • Open the notebook as administrator
  • You open the hosts file located in C: \ Windows \ System32 \ drivers \ etc *
  • You will see your host's name resolution add this line * 127.0.0.1 sisventas.com * , or whatever you want to call your virtual domain
  • Configure Xampp's httpd-vhosts

  • From the same notebook you open the link file located at C: \ xampp \ apache \ conf \ extra
  • You add the following

    <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/sisVentas/public/" ServerName sisventas.com
    </VirtualHost>

  • Restart the xammp service and you can access the sisVentas.com route directly

  • NOTE: Mac host routes will vary such is the case in the Hosts path for mac is / etc / hosts and for the path in xampp is depending where your xampp is located

        
    answered by 10.10.2016 / 15:58
    source
    0

    Another way to access a more direct route with your Laravel app is by executing the command serve

    I'll give you an example with Windows ...

    - Open the window console (CMD)

    - Go to the path of your app using the console ( cd C: / xampp / htdocs / miAppenLaravel )

    - Execute the php artisan serve

    command

    - Go to the browser and enter the path given by the previous command ("localhost: 8000")

        
    answered by 10.10.2016 в 17:03
    0

    I do not know what version of Laravel you are using to work, but in OSX you already have an internal mini server that allows you to run the project without having to configure the Apache, to install the add-on you must do the following in the terminal:

    ~$composer global require laravel/valet
    

    After that you always execute the following in the terminal:

    ~$valet install
    ~$cd sisVentas
    ~/sisVentas$valet link
    

    Then you go to the browser and you can open the project through a local domain similar to this:

    http://sisventas.dev/
    

    All that without doing anything more than a couple of configurations and you will have your local miniserver ready without configuring apache or additional tools.

        
    answered by 11.10.2016 в 20:01