简体   繁体   English

Laravel-如何与其他工作站共享应用程序

[英]Laravel - How to share application to another stations

I developed an application with laravel and i put it in a local server and i need that other computer access it. 我用laravel开发了一个应用程序,并将其放在本地服务器中,我需要其他计算机来访问它。

I think that have 2 solutions: 我认为有2个解决方案:

First: Access to laravel server (port 8000) Second: Put the project in xampp 第一:访问laravel服务器(端口8000) 第二:将项目放入xampp

What is the best solution? 最好的解决方案是什么?

With the first option i can't access and with xampp it doesn't access well to routes and doesn't load the css and js files. 使用第一个选项,我无法访问,使用xampp,它不能很好地访问路由,也无法加载css和js文件。 If i access to root folder it list the project folders and i have to go to public folder but doesn't load stylesheet files. 如果我访问根文件夹,它将列出项目文件夹,而我必须转到公用文件夹,但不会加载样式表文件。

How can i do that? 我怎样才能做到这一点?

UPDATE: 更新:

I did this steps and this not work yet. 我做了这个步骤,这还行不通。

In httpd.conf enable this line Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf httpd.conf启用此行Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Next i add a host in in hosts file: 接下来,我在主机文件中添加主机:

127.0.0.1 arquivo.localhost

Next i'm going to httpd-vhosts.conf and add this: 接下来,我要转到httpd-vhosts.conf并添加以下内容:

<VirtualHost *:8888>
  DocumentRoot "/Applications/MAMP/htdocs/arquivo/public"
  ServerAdmin arquivo.localhost
  <Directory "/Applications/MAMP/htdocs/arquivo/public">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
  </Directory>
</VirtualHost>

Next i restart the apache and when i try to access to http://arquivo.localhost this give me This site can't be reached 接下来,我重新启动apache,当我尝试访问http://arquivo.localhost这给了我This site can't be reached访问的机会

What i'm doing wrong? 我做错了什么?

Thank you 谢谢

create virtualhost under xampp/apache/conf/extra/httpd-vhost.conf like this 像这样在xampp / apache / conf / extra / httpd-vhost.conf下创建virtualhost

<VirtualHost *:80>
ServerAdmin webmaster@localhost.com
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.localhost
ErrorLog "logs/laravel-error.log"
CustomLog "logs/laravel-access.log" common
</VirtualHost>

and access with http://laravel.localhost/ 并使用http://laravel.localhost/访问

If its working fine on your localhost, other person can access your site using your Ip address, provided you both are on same local network. 如果它在您的本地主机上运行正常,那么只要您俩都在同一本地网络上,其他人就可以使用您的Ip地址访问您的站点。

For more you can see this reference : Accessing localhost (xampp) from another computer over LAN network - how to? 有关更多信息,请参见以下参考: 通过LAN网络从另一台计算机访问localhost(xampp)-如何?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何与另一个 PHP 应用程序共享 Laravel 会话? - How do i share Laravel session with another PHP application? 如何在同一服务器上的Web应用程序(Core PHP)和另一个Web应用程序(Laravel)之间共享会话? - How to share Session between Web Application (Core PHP) and another Web Application (Laravel) on Same Server? 如何在本机 php 应用程序和 Laravel 应用程序之间共享会话? - How to share session between a native php application and a laravel application? 如何使用Laravel框架在应用程序控制器之间共享代码? - How share code between application controllers using Laravel framework? Laravel-如何将文件上传到本地主机上的另一个应用程序? - Laravel - how to upload file to another application on localhost? 如何从另一个Laravel应用程序中捕获Laravel错误? - How can I catch a Laravel error from another Laravel application? 如何在另一个Web应用程序中嵌入Laravel应用程序? - How to embed a Laravel application within another web application? 在整个 Laravel 应用程序中共享一个变量 - Share a variable through out Laravel application 在Laravel中与另一个视图共享表单数据 - Share form data with another view in Laravel 如何分享宅基地laravel项目 - how to share homestead laravel project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM