Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a new project with Laravel throws an exception

Tags:

laravel

I have installed Composer, Laravel, and PHP 7.1.22 with all extensions.

Now I try to create a new project using "laravel new projectname". It throws the exception below. How can I fix this problem?

[GuzzleHttp\Exception\ConnectException] cURL error 7: Failed to connect to localhost port 1080: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

like image 499
Medet Avatar asked Aug 09 '19 07:08

Medet


People also ask

How do I disable error reporting in Laravel?

You may turn off error details by setting the debug option in your app/config/app. php file to false .

How does Laravel define exception?

Laravel can handle custom exceptions automatically when the exception is created in a certain way. First, the exception has to extend the Exception class and then, in case you want to render something to the end user, you have to override the render() function.

What is throwable Laravel?

Throwable is the base interface for any object that can be thrown via a throw statement, including Error and Exception.


2 Answers

Try to remove ";" in extensions before the curl extension in your php.ini file.

like image 72
Mahri Ilmedova Avatar answered Oct 22 '22 00:10

Mahri Ilmedova


If the laravel command fail you can try with composer create-project:

composer create-project --prefer-dist laravel/laravel projectname
like image 45
dparoli Avatar answered Oct 22 '22 01:10

dparoli