I had exactly the same issue on a Linux system with PHP 5.4.4.
My "solution" was to use composer directly:
composer create-project laravel/laravel lara50
where lara50 is the directory for the new application.
My solution is developing a Xampp, Wamp replacement: http://laravel.io/forum/12-15-2014-introduce-laragon-mr-wamp-laravel-memcached-redis-on-windows-in-a-minute
With Laragon, you will work with Laravel on Windows without any trouble and develop modern apps with memcached and redis is easily
i have solved this by deleting created project
rmdir projectname
laravel new projectname
hop it helpes you!
I had the same issue
I solved this by updating the version of the laravel installer. I had the 1.1 version. So I changed the ~/.composer/composer.json file
{
"require": {
"laravel/installer": "^1.2"
}
}
After that I run composer global update
and everything work perfect!
I can able to debug and resolve this issue. It turns out to be a network issue(firewall) for me!
I observed the command “laravel new ” is working fine in my home network but I am getting the following error in office network,
PHP Warning: ZipArchive::extractTo(): Invalid or unitialized Zip object in C:\Users\Rajesh Kumar Raj\AppData\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 157
So, I decided to debug the NewCommand.php file.
I noticed the following function is trying to download a zip file by calling the URL http://cabinet.laravel.com/latest.zip
protected function download($zipFile, $version = 'master')
{
switch ($version) {
case 'develop':
$filename = 'latest-develop.zip';
break;
case 'master':
$filename = 'latest.zip';
break;
}
$response = (new Client)->get('http://cabinet.laravel.com/'.$filename);
file_put_contents($zipFile, $response->getBody());
return $this;
}
I tried typing the URL in my browser and I got a firewall error since the URL includes a .zip extension. So, I asked my network administrator to exclude check for this URL.
Then the project got created successfully without any issues.
So, the solution is, try accessing the URL (http://cabinet.laravel.com/latest.zip) from your browser. If it’s not working contact network admin or try executing the command from your home/mobile network. Hope this helps. Thank You.
Please note, I am using Composer version 1.5.2 and Laravel Installer Version 1.4
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community