: This article describes how to install Laravel5 in Linode. if you are interested in the PHP Tutorial, refer to it. I learned about PHP a few days ago and found the Laravel framework. I started to see version 4.2. last Thursday, I suddenly found Laravel 5 officially launched.
I am not very familiar with frameworks, because I am not engaged in code, but I have been very interested in programming and started to read it. I have read Yii before, and I'm dizzy. I really don't like it, but Laravel feels comfortable at first glance.
Today, I spent a long time installing Laravel 5 on Linode and finally reached the welcome page.
- Apply for a Linode server, I use ubuntu 14.4
Install PHP
- Sudo apt-get update // repository list upgrade
- Sudo apt-get install apache2 // install apache server, ver 2.4.7
- Sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql // install mysql
- Sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt // install php5, mcrypt this extension is required by Laravel
If you need to install other modules
Apt-cache search php5-// Obtain the module list
// List
The php5-cgi-server-side, HTML-embedded scripting language (CGI binary)
Php5-cli-command-line interpreter for the php5 scripting language
Php5-common-Common files for packages built from the php5 source
Php5-curl-CURL module for php5
Php5-dbg-Debug symbols for PHP5
Php5-dev-Files for PHP5 module development
Php5-gd-GD module for php5
Php5-gmp-GMP module for php5
Php5-ldap-LDAP module for php5
Php5-mysql-MySQL module for php5
Php5-odbc-ODBC module for php5
Php5-pgsql-PostgreSQL module for php5
Php5-pspell-pspell module for php5
Php5-recode-recode module for php5
Php5-snmp-SNMP module for php5
Php5-sqlite-SQLite module for php5
Php5-tidy-tidy module for php5
Php5-xmlrpc-XML-RPC module for php5
Php5-xsl-XSL module for php5
Php5-adodb-Extension optimising the ADOdb database into action library
Php5-auth-pam-A PHP5 extension for PAM authentication
Sudo apt-get install name of the module // install
Install Laravel
- Curl-sS https://getcomposer.org/installer | php // install composer
- Composer global require "laravel/installer = ~ 1.1 "// download installer
- Export $ PATH = PATH :"~ // Composer/vendor/bin "// add environment variables to facilitate the direct execution of Laravel
- Now we can use the Laravel command to create a new site.
Eg:
Go to the var/www/html folder and execute
Laravel new mysite
After the execution is complete, a mysite folder will be created, even if Laravel is downloaded
Simply configure the Vhost on the server to point to this site
Because apache2 is 2.4.7, the configuration is slightly different.
Laravel requires sudo a2enmod rewrite // enable the rewrite module
Configuring Vhost // It takes some time today
Go to The etc/apache2/folder and find sites-available.
The name before cp default. conf mysite.com. conf // "conf" must be the same as the site you want.
Edit and save
ServerName mysite.com ServerAlias mysite.com ServerAdmin webmaster@mysite.com DocumentRoot/var/www/html/mysite/public/# here is public, laravel starts from the index. php file here
AllowOverrideAll # This place is required. today we have taken many detours. Here Options + ExecCGI-MultiViews + SymLinksIfOwnerMatch Order allow, deny Allow from all
ErrorLog $ {APACHE_LOG_DIR}/error. log CustomLog $ {APACHE_LOG_DIR}/access. log combined
Add a new site to the server
A2ensite mysite.com. conf (delete a2disite xxxxx)
If several sites are enabled, you can view the files in the sites-enable folder ..
The storage folder in the Laravel directory must be writable. Laravel uses this folder as the session storage area.
- Check. htaccess under public in the mystie folder. here is Laravel's overwrite configuration.
All done. go to Domain to point A record, and then OK.
Call .. Record what you did today. today, I 've been tossing this redirection for a long time.
Because it is not enabled
AllowOverride All
Write it here as a record. if you accidentally help someone, it's good!
The above describes how to install Laravel in Linode, including related content. I hope my friends who are interested in PHP will be helpful.