简体   繁体   English

使用共享主机在附加域上安装laravel应用

[英]installing laravel app on addon domain with shared hosting

I've searched up and down and while there are a lot of the same solutions out there that show how to do this, none of them seem to be working (surely, I having something configured wrong here). 我已经上下搜索,虽然有很多相同的解决方案可以显示如何执行此操作,但它们似乎都没有用(当然,我在这里配置了错误的东西)。

I am trying to deploy a laravel app on an addon domain with shared hosting. 我正在尝试在具有共享托管的插件域上部署laravel应用。

I have uploaded my app (all but the public folder) along side the public_html folder (same level, not inside it). 我已经将我的应用程序(除了公共文件夹以外的所有文件)与public_html文件夹(相同级别,而不是内部)一起上传了。

Structure: https://imgur.com/a/fiyGxzC 结构: https//imgur.com/a/fiyGxzC

I've taken everything from the public folder and put it inside a folder on the addon domain. 我已经从公用文件夹中拿走了所有内容,并将其放在插件域的文件夹中。

Ex.: public_html/mysite.com/laravel/ 例如:public_html / mysite.com / laravel /

Note that I've substituted my actual username and domain with placeholders here (obviously) 请注意,我已经在这里用占位符替换了实际的用户名和域(很明显)

This is where it gets tricky for me. 这对我来说很棘手。 I've tried adjusting the paths in the public_html/mysite.com/laravel/index.php file, but the DIR method/command seems to be grabbing from the wrong directory and I get the following errors: 我尝试调整public_html / mysite.com / laravel / index.php文件中的路径,但是DIR方法/命令似乎是从错误的目录中获取的,并且出现以下错误:

Warning: require(/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php): failed to open stream: No such file or directory in /home1/username/public_html/mysite.com/laravel/index.php on line 22 警告:require(/home1/username/public_html/mysite.com/laravel /../../ laravelapp / bootstrap / autoload.php):无法打开流:/ home1 / username / public_html /中没有此类文件或目录第22行的mysite.com/laravel/index.php

Warning: require(/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php): failed to open stream: No such file or directory in /home1/username/public_html/mysite.com/laravel/index.php on line 22 警告:require(/home1/username/public_html/mysite.com/laravel /../../ laravelapp / bootstrap / autoload.php):无法打开流:/ home1 / username / public_html /中没有此类文件或目录第22行的mysite.com/laravel/index.php

Fatal error: require(): Failed opening required '/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php' (include_path='.:/opt/php71/lib/php') in /home1/username/public_html/mysite.com/laravel/index.php on line 22 致命错误:require():无法打开所需的'/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php'(include_path ='。:/ opt / php71 / lib /home1/username/public_html/mysite.com/laravel/index.php在第22行上的/ php')

Do note that I've tried modifying to document root by trying it with a subdomain, but ran into the same type of errors. 请注意,我尝试通过使用子域来修改文档根目录,但是遇到了相同类型的错误。

Also note that when I put the entire app (including public) inside a folder inside the addon domain (ex.: mysite.com/testing), I was able to get things working, but the images and styles would not load. 还要注意,当我将整个应用程序(包括公共应用程序)放入插件域(例如:mysite.com/testing)内的文件夹中时,我可以使事情工作,但是图像和样式无法加载。 I know this is a security risk, so I'm trying to do it the correct way now and get everything running smoothly. 我知道这是安全隐患,因此我现在尝试以正确的方式进行操作,并使所有操作顺利进行。

Some help here would be greatly appreciated - been on this for 2 days now. 这里的一些帮助将不胜感激-到目前为止已经进行了2天。 Thanks a lot! 非常感谢! Sorry for any redundancy here. 很抱歉在这里有任何冗余。

Edit: I've also tried modifying my path in the server.php (this was suggested on another solution) to "../public_html/mysite.com/laravel/index.php" and to no avail as well. 编辑:我也尝试将server.php中的路径(这是另一种解决方案建议)修改为“ ../public_html/mysite.com/laravel/index.php”,但也无济于事。

You said you put your app on the same level as public_html. 您说过将您的应用置于与public_html相同的级别。 That means on /home1/username but you only use two .. which maps to /home1/username/public_html 这意味着在/ home1 / username上,但是您仅使用两个..映射到/ home1 / username / public_html

You should use it three times /home1/username/public_html/mysite.com/laravel/../../../ 您应该使用它三遍/home1/username/public_html/mysite.com/laravel/../../../

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM