Host lookup failed when executing artisan on Laravel - php

I keep getting this error when trying to execute artisan.
In UdpSocket.php line 47:
socket_sendto(): Host lookup failed [-10001]: Unknown host
The problem seems to be affecting composer as well.
I run Laravel 5.5 on a homestead virtual machine, everything was working as expected until this problem arrived in a very random way.
I really don't know where to start to debug this,
Thanks for the help!

Related

disable symfony 5 database connection

I have the default config in my symfonu project I have this line at .env file
DATABASE_URL="postgresql://db_user:db_password#127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
and I get this error
An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
Of course I dont have not isntalled postgres, and I dont need a database for this project, How I cant fix this error I tried to comment the .env file line but I get another error
Commenting the line as L3xpert answer suggests doesn't seem to do the job.
It will throw the error :
Environment variable not found: "DATABASE_URL".
If you don't need Doctrine but you have Website-Skeleton installed, you can remove Doctrine by running this command :
composer remove doctrine/doctrine-bundle doctrine/doctrine-migrations-bundle

Can't generate my database with Doctrine ORM (Could not find driver)

So, I just started using Doctrine, and it's also my first time using Symfony 5.
I used the Maker bundle to generate my first entity, and I completed the DATABASE_URL in my .env, but I can't generate my database with "php bin/console make:migration".
I got these errors:
In AbstractMySQLDriver.php line 106:
An exception occurred in driver: could not find driver
In PDOConnection.php line 31:
could not find driver
In PDOConnection.php line 27:
could not find driver
I searched for a solution, most of the time it's because the corresponding extension is missing... but not in my case !
This is my DATABASE_URL in my .env. I didn't modified anything else.
DATABASE_URL=mysql://myusername:mypassword#localhost:3306/mydatabase?serverVersion=5.7
I'm a complete newbie, and I'm a bit lost.
Can you help me please ?
Thank you !
EDIT: sorry, I totally forgot the most important. Im on Windows 10 with the last version of WAMP, and I installed PHP 7.4.7.
All the extensions are activated, and php -m return them !

server,php file missing, fatal error

I have been using laravel for multiple projects already, however for some reason my new laravel project does not have the server.php file.
Reinstalling composer and / or recreating the project does not work. I also can't put a file by the name of server.php into the project in any way.
[Fri May 11 02:26:55 2018] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Fri May 11 02:26:55 2018] PHP Fatal error: Unknown: Failed opening required 'C:\Users\Luke Derkzen\Documents\GitHub\Website\server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0
I get this error when I try to start the server, as far as I can see it's expecting me to have something running on XAMPP, however on my other projects there is a server.php file, and it doesn't give above error.
The project was created with following command:
composer create-project --prefer-dist laravel/laravel
If i use the php artisan serve command afterwards to start the server and reload the page. above error appears in the artisan console.
How can I fix this?
Server.php make a Exception and your Anti-Virus like Avast delete it Automatically. Make turn off your Anti-VIrus Software.
The problem occured, as rightly predicted by some, due to corrupt windows permissions. I talked about it with microsoft support, however they could offer no solution (without paying $50 / $150) so I did a clean install of windows.
While I'm sure this isn't a solution people hope to find, it was the only way for me.

Failed to connect to: localhost:27017: Connection refused

I have installed MongoDB in xampp on Ubuntu using Laravel 5.1. But I always get this error
MongoConnectionException in TestController.php line 19: Failed to
connect to: localhost:27017: Connection refused
Nor I'm able
I have gone through a lot of questions, but all proved to be trivial solution.
Please help me with this as I'm stuck on it.
I think that first thing to do is to ssh on that server and check that mongod process is alive, then try open mongo shell using command - mongo . If all works try telnet on this server and port from your machine ,if there is no errors , read mongo logs

Installing Laravel resulted in unable to find the socket transport ssl

Hi I am trying to install laravel on my server.This is what I did.First I installed composer and tryed running this command in cmd:
composer create-project laravel/laravel RestPHP
After running it I got this this message:
I tryed googeling about this error but could not find anything concrete regarding this error I am very new to php.
After this I tryed a more manual approach.I downloaded laravel and put it in my htdocs folder , then I tryed openning it like this:
http://localhost:8585/laravel/public/
But I got this message:
Warning: require(E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php'
(include_path='.;E:\Projects IDE\PHPStorm\xampp\php\PEAR') in
E:\Projects IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php
on line 17
I have my htdocs route at:
E:\Projects IDE\PHPStorm\xampp\htdocs
Both cases seem to be some for of php configuration problem , since I have 0 knowledge of that I could not find a solution.
Could someone please provided me with a step by step solution?
UPDATE
I managed to enable socket transparency ssl and after trying to run the command I get this:
I have also installed git but I still get the same error.What can I do?
Try enabling php_sockets and open_ssl in your php ini

Categories