Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TomCawthorn's avatar

Can't use laravel new app-name

Hello!

Maybe you can help me with my problem.. I'm just starting out with larabook. I've used Laravel before and have made some beginner applications before taking a break. Since coming back, I see an error when using the 'laravel new' command.

It's exactly the same issue as here: https://laracasts.com/discuss/channels/general-discussion/laravel-new-error

This fix does work, but I want to try and get laravel new working - because that would be nice :)

I get this error message when running 'laravel new larabook'

  [Guzzle\Http\Exception\ClientErrorResponseException]  
  Client error response                                 
  [status code] 404                                     
  [reason phrase] Not Found                             
  [url] http://192.241.224.13/laravel-craft.zip 

I realize the URL has been updated recently, and when I try and update the installer:

composer global require "laravel/installer=~1.1"

I get

Changed current directory to /Users/Tom/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/DependencyResolver/RuleWatchNode.php on line 40

If I remember correctly I installed via brew and have run brew doctor and brew update without issue and the error message persists.

Can anyone help me? :)

0 likes
15 replies
TomCawthorn's avatar

I must add that I have also restarted terminal between steps!

TomCawthorn's avatar

Hi Bashy,

I can indeed install via composer and this works fine. However, I want to learn why this particular aspect isn't working and hopefully find a fix :-)

kreitje's avatar

You are using an older version. The URL to the zip file it downloads was changed a while back. It now uses a domain name instead of an IP address.

TomCawthorn's avatar

That's absolutely bang on, and I've mentioned this in my original post. When I try and update by using

composer global require "laravel/installer=~1.1"

I get an error message (above). Am I not updating correctly? / Can you remember how you updated yours?

Thanks!

slawisha's avatar

Run composer global require "laravel/installer" when it asks for version give it 1.1.3 it should remove old and install newest laravel installer which is at this moment 1.1.3

1 like
TomCawthorn's avatar

Great! That went through and updated the version to 1.1.3. The trouble is, when I try and create a new project I still get the same error message - the url is still pointing to the wrong location :(

I think this might be a deeper issue, potentially something to do with composer requiring more memory to update? To get larabook started, I created the application with composer but when I later tried to add dependencies via composer, it complained once more about memory useage and canceled.

I have looked into changing the php.ini file.. But from what I've read, lots of people saying that this is a bug fix for something that shouldn't be happening in the first place.

https://github.com/composer/composer/issues/1898

I don't want to change a setting on my local machine that can't be easily changed on a production server (if I were to ever get that far with my own applications!)

I didn't change my php.ini file and instead ran a

composer update-self

This seemed to fix the issue of composer update within a project.

laravel new application-name is still not functioning properly, even though I have delete laravel/ directory from the vendor folder and reinstalled.

Thanks all for you help so far, If you can offer any other advice, that would be smashing!

bashy's avatar

I think it's better to just use composer to do it... "laravel new blog" might be easy to remember but at this point, you should be learning composer commands.

TomCawthorn's avatar

I agree. It's just annoying because the issue is with composer updating - which I can see is pretty necessary in laravel development!

bashy's avatar

So what's not working in composer? Just the memory issue?

Also I don't believe composer update-self is valid

[InvalidArgumentException]
Command "update-self" is not defined.

Did you mean either of these?

» composer self-update
You are already using composer version 2cb64c8a7254b748617baeff4316654bcf6bb551.
------------------------------------------------------------
» composer selfupdate
You are already using composer version 2cb64c8a7254b748617baeff4316654bcf6bb551.
TomCawthorn's avatar

Ah! Yes, I did mean one of those - a typo in my post because I did get success following the command - not an error message.

It's looking like a composer memory issue, which is stopping updates for the (am i right in saying) 'global' composer resources on my machine. I have researched a fix which requires changing the threshold in php.ini to a greater value, but I don't want to change anything I couldn't recreate on a production server. i.e. Shouldn't it work without having to increase the memory threshold!

Thanks for your help

bashy's avatar

To use less memory on the production server, you shouldn't do composer update, instead do this;

  1. On local env, run composer update
  2. Copy over the composer.lock with all the files to the production server
  3. Run composer install

Other than that, whack up your PHP memory_limit to 512M or 1024M, anything local for development is fine using high values. Although, I've never had a problem using composer with 256M

TomCawthorn's avatar

I can see that would keep the memory low, but composer update is the command I'm currently having memory issues using!

I think this is a really good excuse to get a new computer :p

Thanks for all you help, I'll look into increasing the memory limit for now and then tackle issues as and when they arise! :-)

bashy's avatar

What do you have your PHP setting: memory_limit set to? 256M should be enough, maybe it's set to 32M or something silly

undrwd's avatar

You'll need to delete the laravel file (probably in usr/local/bin) if you installed laravel previously . . . otherwise it will keep using the legacy version that is trying to pull the file from http://192.241.224.13/laravel-craft.zip. You can check this by typing laravel --version in terminal. If you get laravel craft 1.0 you have a local laravel file that needs to be deleted. After that you can run composer global require "laravel/installer=~1.1.3" and then follow this step so you can use just 'laravel' in the terminal. Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable is found when you run the laravel command in your terminal. (http://laravel.com/docs/4.2/installation)

4 likes

Please or to participate in this conversation.