PHP Laravel Framework installation and related open source software

Source: Internet
Author: User

Laravel is known as a concise, elegant PHP development framework, but the first contact with the framework of many people are stuck in the installation, in fact, in Linux only need a very simple few steps can be done, here we take CentOS under the PHP + Nginx + Mysql environment for example.

First, you need to understand Laravel installation dependencies, such as Laravel4.2 have the following requirements: PHP >= 5.4-mcrypt PHP extension
The main is the PHP version, the normal installation of the relevant extension should be included

In addition, your system needs to have Composer, a PHP dependency management tool, not installed can be downloaded here: https://getcomposer.org/download/then rename the Composer.phar file to Composer in/usr Under the/bin directory

Next, set the composer mirror address

composer config -g repositories.packagist composer http://packagist.phpcomposer.com  

The last is to install laravel with composer. Version, installation path can be specified in the parameters, here we installed 4.2 version, placed in the Nginx site root directory

composer create-project laravel/laravel=4.2 /usr/local/nginx/html/laravel4.2 --prefer-dist  

Remember to change Laravel directory permissions after successful installation

chmod 777 -R /usr/local/nginx/html/laravel4.2  

Not surprisingly, you can access the Laravel Welcome page on your browser.

Only the framework is certainly not enough, there is a lot of content to add, on the Internet to find some open source software based on Laravel, we try a simple Laravel5.1 on the development of the blog program, called Laravel51, on GitHub can download: https:// Github.com/mangoim/laravel51

The installation procedure is also simple, first pull it down with git

git clone https://github.com/mangoim/laravel51.git  

Create a database laravel51 on MySQL, and then import the SQL file

mysql -u root -p laravel51 < /usr/local/nginx/html/laravel51/laravel51.sql  

To modify a configuration in a database script

vim /usr/local/nginx/html/laravel51/config/database.php  

Change to MySQL field, username and password according to your local MySQL settings to modify

‘mysql‘ => [              ‘driver‘    => ‘mysql‘,            ‘host‘      => ‘localhost‘,            ‘database‘  => ‘laravel51‘,            ‘username‘  => ‘root‘,            ‘password‘  => ‘123456‘,            ‘charset‘   => ‘utf8‘,            ‘collation‘ => ‘utf8_unicode_ci‘,            ‘prefix‘    => ‘‘,            ‘strict‘    => false,        ],

Configure a new port under Nginx

vim /usr/local/nginx/conf/nginx.conf  

Here I set the port to 7070

Restart the server, the browser under 7070 access to index.php, there should be a page like this

Background function also developed part, Access index.php/admin, user name: Roy Password: 123456

Finally recommend some useful URLs: the most important is the official documents, want to learn more about the needs of Laravel take a look: Http://www.golaravel.com/laravel/docs also has a domestic developer to write the introductory tutorial, Suitable for beginners: https://lvwenhan.com/laravel/432.html Below is a CMS based on Laravel4.2, in fact, many of these projects are personal in the spare time development, we use the cooked laravel after you can do one, In case of fire. (HTTP://SIMPLA.SIMPLAHUB.COM/;HTTPS://GIT.OSCHINA.NET/KEN.YANG/SIMPLA)

OneAPM for PHP is able to drill down into all of the PHP applications to perform application performance management in-depth application performance management and monitoring within all PHP applications, including code-level visibility, rapid identification and traceability of performance bottlenecks, real user experience monitoring, Server monitoring and end-to-end application performance management. To read more technical articles, please visit the OneAPM Official technology blog.

Turn from: http://news.oneapm.com/laravel-php/more: http://www.oneapm.com/ai/php/laravel.html

PHP Laravel Framework installation and related open source software

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.