How do I deploy Laravel projects on virtual space?

Source: Internet
Author: User
Tags symlink cpanel
Other frameworks just upload, but you know Lavarel's portal file is under the public folder, so .... How to deploy? or the whole upload and then redirect all the visits to public. Do not understand, please the talent advice.

By the way, it's not normal for the entry file to be placed under public. Too much trouble to add, what is the special reason?

Reply content:

Other frameworks just upload, but you know Lavarel's portal file is under the public folder, so .... How to deploy? or the whole upload and then redirect all the visits to public. Do not understand, please the talent advice.

By the way, it's not normal for the entry file to be placed under public. Too much trouble to add, what is the special reason?

You need to face this problem squarely--you do need to bind the domain name to the public folder. However, this binding does not need to be "real" binding, and it is possible to use symbolic links to work around the implementation. (That is, if the binding position cannot be changed, replace the bind location with a symbolic link to the location you really want)

For the common Linux platform PHP space:

    • For DA, there is essentially no concept of a primary domain, and each domain name is bound to~/domains/yourdomain.com/public_html
    • For cpanel, the primary domain is fixed to bind to the~/public_html
    • cpanel addon Domains can customize the binding location (problem natural resolution)

So for the above scenario 1 and 2, you can install the laravel in a different place, and then delete the original folder as the binding location, replacing it with symbolic links. You can use PHP's Symlink () function to create symbolic links.

I'm here to inquire about the answers to the above questions.
Symlink () exactly where to put it? Also, I built a link to/public/index.php directly in the Laravel project root directory, named index.php line? Hope the relevant people help, thank you!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.