laravel Installation and Configuration Tutorial

  • 2021-07-24 10:15:37
  • OfStack

System environment requirements

apache, nginx or other web servers;
laravel uses one of the powerful features of PHP, so it needs to be implemented on PHP 5.3 or later;
Laravel uses FileInfo library (http://php.net/manual/en/book.fileinfo. php) to detect the mime type of files. This library is included by default in PHP5.3, but in Windows, users need to open this module in php. ini themselves. If you don't understand, you can see here: http://php.net/manual/en/fileinfo.installation;
Laravel uses Mcrypt library (http://php.net/manual/en/book.mcrypt. php) to encrypt and generate hash. Before using this framework, you need to ensure that this extension is installed. You can use phpinfo (); Check the correct installation in the web server, if not: http://php.net/manual/en/book.mcrypt.php;

Installing laravel

Download laravel: http://laravel.com/download;
Decompress the compressed package file and upload it to web server;
Set the value of key in config/application. php, and you can set a random content composed of 32 strings;
Verify that storage/views is writable;
Access your application in the browser;

At this point, you have completed the installation of an Laravel, and there are more things to know here.

Additional content

Install the following additional extensions so that you can make full use of Laravel

SQLite, MySQL, PostgreSQL, or SQL Server PDO drivers.
Memcached or APC.

Question?

If you have installation problems, try the following:

Make sure that the public directory is the root directory of your site (see server configuration below)

If you use mod_rewrite, set the index entry in application/config/application. php to null.

Verify that your storage folder is writable.

Server configuration

Here we guarantee a basic apache configuration, and the root directory of our Laravel is at:/Users/JonSnow/Sites/MySite

The configuration information is as follows:


<VirtualHost *:80>
    DocumentRoot /Users/JonSnow/Sites/MySite/public
    ServerName mysite.dev
</VirtualHost>

Note: We installed the/Users/JonSnow/Sites/MySite, our DocumentRoot to/Users/JonSnow/Sites/MySite/public.

Getting started with Laravel uses Windows environment, but you are not required to use Windows as well. You can do it under your favorite system.

Installation of the PHP runtime environment is beyond the scope of this tutorial, and only the basic requirements are explained here.

Web Server:

PHP 5.3 and above
PDO Module
Mcrypt Module
MYSQL database
The environment used in this tutorial:

PHP 5.4.5
MYSQL 5.0.45
Install the Laravel framework:

Download Laravel Framework: Laravel Official Download Github Download
Unzip the frame to the server directory
The simple two-step Laravel framework is installed. To test whether the installation is successful, visit it in the browser:

http://localhost/public/

The public directory is the folder that comes with the framework. If you see the initial interface of laravel, it means that it has been installed successfully.


Related articles: