How to make the Laravel framework quick to install on a local virtual machine

Source: Internet
Author: User
Tags install php php compiler
This article mainly introduced the Laravel framework in the local virtual machine rapid installation method, combined with the case form more detailed analysis of the Laravel framework installation steps, operational considerations, and with the CENTOS7 environment PHP7 compiled installation Curl expansion of the specific steps, A friend you need can refer to the following

The example in this article describes how the Laravel framework is quickly installed on the local virtual machine. Share to everyone for your reference, as follows:

Always want to learn larvael, can seem to find simple installation will waste a long time, maybe I am a novice relationship it.

I am a Linux system installed on a local virtual machine, Centos7 plus PHP7

The first step : to ensure that the correct installation of curl on your machine, the specific method can be described in the appendix

Step two : Using Curl to install composer, you have to understand that composer is a PHP-based installation package management tool that serves the PHP ecosystem.

The installation commands are as follows:

Curl-ss Https://getcomposer.org/installer | Php

You must keep the network stable, or you will have a lot of trouble.

When the above composer installation is complete, you will be prompted to Composer.phar the directory, and then

Perform the MV Composer.phar/usr/local/bin/composer add to the Global command, and then you can use the composer simplify command to work with composer

Step three : Install Laravel:

When using the root user installation, you may be prompted what permissions problem, when you need adduser a user name, add a user, then passwd the user name, add a password, and then the su new user name switch to the normal user

However, when performing the installation laravel, unless you are using a smooth VPN, it is still slow and a lot of problems.

At this point you can switch the composer source, to the domestic, see composer Domestic mirror https://pkg.phpcomposer.com/, using any method provided by the official website to switch the source.

Then perform composer Create-project laravel/laravel your-project-name--prefer-dist "5.1.*" installation, will Your_ Project-name Replace the directory you want to install is followed by the version number, I'm using 5.1

When executing the above installation commands, remember to go ahead to the directory you want to install. Because the default is the directory that is installed under the current execution command.

And wait for the installation to succeed.

Phpunit/php-code-coverage suggests installing Ext-xdebug (>=2.2.1)
Phpunit/phpunit suggests installing Phpunit/php-invoker (~1.1)
Phpspec/phpspec suggests installing phpspec/nyan-formatters (~1.0–adds Nyan formatters)
Writing Lock File
Generating autoload files
> illuminate\foundation\composerscripts::p ostupdate
> PHP Artisan Optimize
Generating optimized class Loader
> PHP Artisan key:generate
Application key [Ey7saoccjbcarwsikqavnsvvdjgoa9ti] set successfully.

When the last appearance above, the installation succeeds,

Attached: Linux CENTOS7 environment php7 Compile install PHP expansion Pack Curl

It is stated here that this document is suitable for the CENTOS,PHP7 version installed on the local virtual machine

Tossing nearly a morning, and finally solved the problem

Because after the download curl installation, although the/usr/local/curl directory is established, but it is not possible to perform phpize, because the/lamp/php-7.0.7 below the ext below the curl can be performed phpize, so that life curl.so

PHP Source directory:/lamp/php-7.0.7

php compiler directory:/usr/local/php/

Curl Source directory:/root/curl-7.32.0

1.curl, mainly used to send HTTP requests, is an extension package for PHP.

2. Installation process:

(1) Curl Download: http://curl.haxx.se/download.html

(2) Specific installation process:

wget http://curl.haxx.se/download/curl-7.32.0.tar.gztar zxvf curl-7.32.0.tar.gzcd curl-7.32.0./configure--prefix=/ USR/LOCAL/CURLCD/(PHP source directory, not php compiled directory)/ext/curl

Run Phpize:

/(php compiled directory)/bin/phpize./configure--with-php-config=/(php compiled directory)/bin/php-config--with-curl=/(Curl source directory)

Take my example:

./configure--with-php-config=/usr/local/php/bin/php-config--with-curl=/usr/local/curlmake && make install

Modify PHP.ini to add: extension=curl.so (if no other PHP extensions have been installed, you need to configure extension_dir= "/(PHP post-compilation directory)/lib/php/extensions/ no-debug-non-zts-20121212/", the Extension_dir directory is output when the previous step generates the. so file)

(3) Check whether the installation is successful:

/(PHP post-compilation directory)/bin/php-m | grep curl--Normal Print curl means the installation is successful (Php-m will print out the installed expansion module)

3. Step over the pit:

(1) directly at the top of the source directory of Curl, run phpize, the following error is indicated:

Cannot find CONFIG.M4.
Make sure this you run '/home/zhuyx/local/php-5.5.3/bin/phpize ' in the top level source directory of the module

Reason:

Phpize extension installation, the source package needs to have config.m4 this configuration file, the current extension of the source package does not contain (Memcache is included).

Workaround:

(1) Enter the PHP source package Ext/curl Run Phpize, and then install

(2)./configure--with-php-config=/php Compiled directory/bin/php-config--with-curl=curl source directory

Problem extension:

When installing other PHP extensions, you can take the above solution when you encounter a similar problem.

(2) About php.ini

The landlord first modified the PHP compiled directory/lib/php.ini this file, modified after the new module does not take effect. Later learned that this is the default (compile time does not specify) the extension configuration directory, if the compile time to specify the php.ini directory, the future needs to modify the specified directory php.ini, such as the landlord is the PHP compiled directory/php.ini.

(3) Call curl() the php script, command line can run, browser access prompts the following error:

Fatal error:call to undefined function curl ()

Reason:

Landlord's server is Nginx, after installing the curl extension, no restart PHP-FPM caused.

Workaround:

Restart PHP-FPM.
PS aux | grep php-fpm (Find master process)
Kill-sigint Master Process
Enter php-5.5.3/sbin, execute ./PHP-FPM (start)

The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!

Related Article

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.