Installation in Laravel project gives error

Asked

Viewed 228 times

0

I am following the IT Specialization classes (https://www.youtube.com/watch?v=iPTxznidNHo&list=PLVSNL1PHDWvR3PeLXz6nvBkDhv1IQk4wP&index=1), but when I do the installation of my Windows in Vagrant it will not, and worse, the server is not interpreting PHP... When I execute the command

composer create-project --p                                                                                   
 refer-dist laravel/laravel itp

He answers with this:

Installing laravel/laravel (v5.2.31)
As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.

This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them. //Toda essa frase aparece em amarelo

 - Installing laravel/laravel (v5.2.31): Downloading (100%)
Created project in itp
> php -r "copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 57 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%)//Aqui aparece verde

Here everything appears red

The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952

  [ErrorException]
  proc_open(): fork failed - Cannot allocate memory

Well, after all that I’ve tried:

  1. Reinstalling the VM, Vagrant and Larevel but no success
  2. Restart the computer

What can it be? Besides, any file I put inside the /var/www/html folder in php format does not interpret... I don’t know if this has anything to do with it, but I can access my project from both the ip number (192.168.33.10) and the local host.

  • You have installed some unzip or unrar package?

  • So, actually I just followed in the footsteps of Especializati, according to him it would come with everything I would need, so I just executed the command. Being quite clear, no, I did not install (unless it came with the command I gave).

1 answer

0

Use the parameter dmemory_limit to increase your memory:

sudo php -dmemory_limit=750M composer create-project --p refer-dist laravel/laravel itp

or you can also increase memory swap, just run these 3 commands:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
  • This inside my VM?

  • yes, I updated the answer

  • Just returned Could not open input file: Composer. I guess it didn’t help rs.

  • tries the second way, updated reply

Browser other questions tagged

You are not signed in. Login or sign up in order to post.