两个laravel项目在同一台服务器上。与Auth登录冲突

时间:2017-06-26 07:23:59

标签: laravel laravel-5 laravel-5.2 laravel-5.1 laravel-5.3

当我使用project1登录然后我登录到project2。我的project1将退出。如何通过两个laravel项目同时登录?

我尝试按更改config/session.php

更改path

Project1- config/session.php默认'path' => '/',

Project2- config/session.php我改为'path' => '/pa',

但我无法使用项目2登录 如何使用同一服务器的两个laravel项目使用Auth登录?

1 个答案:

答案 0 :(得分:0)

我认为您正在尝试使用localhost
转到xampp / apache / conf / extra / httpd-vhost.conf 如果你使用的是xampp 像这样制作虚拟主机

<VirtualHost project1.dev>
  DocumentRoot "C:/xampp/htdocs/project1/"
  ServerName project1.dev

  CustomLog "C:/path/to/your/site/logs/project1.dev.access.log" combined
  ErrorLog "C:/path/to/your/site/logs/project1.dev.error.log"

  <Directory "C:/xampp/htdocs/project1">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

比 更多

<VirtualHost project1.dev>
  DocumentRoot "C:/xampp/htdocs/project2/"
  ServerName project1.dev

  CustomLog "C:/path/to/your/site/logs/project2.dev.access.log" combined
  ErrorLog "C:/path/to/your/site/logs/project2.dev.error.log"

  <Directory "C:/xampp/htdocs/project2">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

现在转到

C:/WINDOWS/system32/drivers/etc/hosts

添加此

127.0.0.1 project1.dev
127.0.0.1 project2.dev

现在重新启动系统,它应该修复不同的域不同的会话