Linux Quick Configuration Laravel framework

Source: Internet
Author: User

Composerinstallation

1, to https://getcomposer.org/download/download composer, directly below download the latest version of the composer compression package, extracted after the Composer.phar, rename composer to be placed under /usr/local/bin/ .

2. Toggle Composer 's Chinese Image: Command line execution

Composer Config-g Repo.packagist composer https://packagist.phpcomposer.com

If this step fails, check that the Composer.phar file name is modified and is placed in the environment variable.

( due to " well-known " network reasons, do not switch intra-country Mirror composer cannot be used )

InstallationLaravel

1, mkdir Create a new directory to Place Laravel

2, CD to the directory to execute

Composer Create-project--prefer-dist Laravel/laravel Blog

if you want to download another version, such as 5.3 version, please do:

Composer Create-project--prefer-dist Laravel/laravel blog 5.3.*

Wait a few minutes for the installation to complete, and if the wait time is too long, check composer whether to switch the domestic mirror.

WillLaravelconfigured toApache:

1. CD to laravel root directory, execute

Set the storage/directory to read/write.

2. Configure Apache 's working directory to ./public , which is The public/under the Laravel root directory , like mine. /home/ubuntu/code/blog/public

3. Open Apache rewrite module, execute:

sudo a2enmod rewrite

And then execute

Restart Apache .

4. Visit localhost to see laravel 's Welcome page:

PS: If the route to '/' normally occurs during the use of Laravel, and the route to another location appears 404, check that the Apache rewrite module is open, as well as in the Apache configuration file:

<Directory/var/www>

Options Indexes FollowSymLinks

AllowOverride None

Require all granted

</Directory>

Whether to modify to allowoverride all

Linux Quick Configuration Laravel framework

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.