Composer + laravel in linux, composerlaravel

Source: Internet
Author: User
Tags composer install

Composer + laravel in linux, composerlaravel

1, composer Chinese Network: https://www.phpcomposer.com/

Laravel Chinese Network: https://d.laravel-china.org/

2. The role of composer is to manage dependencies for your project. Install the php package without manual installation. The laravel and yii frameworks are also installed through it. php version 5.23 + is required,

3. Download in linux:

curl -sS https://getcomposer.org/installer | php

Get a composer. phar and use php composer. phar to check whether it can work.

4. If composer. phar works properly, move it to/usr/local/bin/, remove the suffix. phar, and use it anywhere (recommended globally)

mv composer.phar /usr/local/bin/composer

5. Usage of composer: Create a composer in the project root directory. for json files, composer relies on it to manage dependencies. For example, if you want to create a project App under www and use the monolog package for the project, you only need to declare Dependencies under the App, that is, create a composer. json folder with the following content: require a package name (for examplemonolog/monolog) Ing to the package version (for example1.0.*), And then execute install to install the dependency package.

cat>composer.json<<EOF{    "require": {        "monolog/monolog": "1.0.*"    }}EOF
composer install

6. If the download is slow or there are other problems, check the [repositories.packagist.org. url] in the global configuration. If it is packagist.org, replace it with the domestic one. If an error is reported, see 10.

composer config -l
composer config repo.packagist composer https://packagist.phpcomposer.com

7. If only one package is installed or a package is updated, the composer command can be used to solve the problem. For details about the command, see 1 or enter composer. The result is the same as that of 5, composer will be generated eventually. json files. The installed dependent packages are all under the vendor directory.

8. Install the laravel framework using composer: The laravel framework requires the php version. laravel5 + requires php5.3.9 +.

9. Install and create laravel5.2 *

composer create-project laravel/laravel App 5.2.*

10. Problems: Follow the red prompt below, which means that proc_open is disabled in php.

[Symfony\Component\Process\Exception\RuntimeException]                                   The Process class relies on proc_open, which is not available on your PHP installation.

Solution: Go to/usr/local/php/etc/to edit the php. ini configuration file, find disable_functions, and open proc_open, proc_close, proc_nice, proc_terminate, leak, proc_get_status, and putenv one by one.

11. Access localhost/App/public/index. php after laravel is installed, and an error cannot be processed.

Solution: Enable the write permission for the storage directory and vendor directory in laravel for the server.

chmod -R 777 storage&&chmod -R 777 vendor

12. Refresh. The laravel greetings page appears.

 

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.