How to deploy laravel project on the godaddy hosting server (Plesk Onyx CPanel)

可紊 提交于 2021-01-29 08:36:24

问题


I currently new for deploying a project files to the godaddy hosting sites, so before i post this, I read some related question created already here in stackoverflow, I just confuse because there cpanel has public_html folder and my panel has no public html. so right now I experience

HTTP Error 404. The requested resource is not found.

The things only I do is to move the laravel files in the httpdocs.

My CPanel : Plesk Onyx 17.8.11

For the folder structure:

So Inside of httpdocs are all of my laravel files

Website shows like this..

Hope someone help me for this problem.


回答1:


I think the reason your folder structure is like this is that your GoDaddy Hosting is a Windows Shared Hosting.

What to basically need to do is create a folder for your app on the home directory and then on the httpdocs, put the public folder from your app.

GoDaddy Plesk Folder List:

  • cgi-bin
  • error_docs
  • httpdocs
  • logs
  • <your laravel app folder minus the "Public" folder>

Inside the httpdocs folder:

  • App_Data
  • .user.ini
  • Default.aspx
  • web.config
  • <+ contents of your Public folder>

Once this is complete, you will need to edit a few files:

From Public Folder: index.php

Find:

require __DIR__.'/../vendor/autoload.php';

Change to:

require __DIR__.'/../<laravel app folder>/vendor/autoload.php';

Next Find:

$app = require_once __DIR__.'/../bootstrap/app.php';

Change to:

$app = require_once __DIR__.'/../<laravel app folder>/bootstrap/app.php';

After this, make sure the .env file is properly configured and all the tables from your local database is mirrored in you server database.

Also, if you have open_dir problems, you can disable it on the PHP Settings from Plesk but I am not sure what are the issues this will cause in the long run.



来源:https://stackoverflow.com/questions/62826905/how-to-deploy-laravel-project-on-the-godaddy-hosting-server-plesk-onyx-cpanel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!