I was learning PHP a few days ago and discovered the Laravel framework. When I first saw it, it was version 4.2. Last Thursday, I suddenly discovered that Laravel 5 was officially launched.
I haven’t had much exposure to frameworks because I’m not a coder, but I’ve always been interested in programming, so I started reading. I’ve seen Yii before and it made me dizzy. To be honest, I really don’t like it very much, but Laravel made me feel comfortable after seeing it.
I spent most of the day trying to install Laravel 5 on Linode, and I finally got to the welcome page. I’m very happy.
Install PHP
If you need to install other modules
apt-cache search php5- //Get module list
//List
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 optimizing the ADOdb database abstraction library
php5-auth-pam - A PHP5 extension for PAM authentication
sudo apt-get install name of the module // Install
Install Laravel
Simple configuration of the Vhost on the server points to this site
Because apache2 is version 2.4.7, the configuration is slightly different
Laravel needs sudo a2enmod rewrite //Enable the rewrite module
Configure Vhost //Spent some time here today
Enter the etc/apache2/ folder and find sites-available
cp default.conf mysite.com.conf //The name before "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/ #这里是public,laravel开始是从这里的index.php文件开始的 AllowOverrideAll #这个地方是要的,今天走了很多弯路这里 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from allErrorLog${APACHE_LOG_DIR}/error.log CustomLog${APACHE_LOG_DIR}/access.log combined
Add new site to server
a2ensite mysite.com.conf (use a2disite xxxxx to delete)
To check how many sites are enabled, go to the sites-enable folder and look at the files. .
The storage folder in the Laravel directory needs to be given writable permission. Laravel uses this folder as the session storage area
It’s all done, just go to the Domain and make an A record pointing to it, and then it’s OK
Phew. . Record what I did today. I spent a long time working on this redirection today
Because it is not turned on
AllowOverride All
Write this part here as a record, in case you accidentally help someone, it is also considered a good deed!
The above introduces the notes on Linode installation of Laravel 5, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.