I have MAMP and i have successfully connected my mac's default php path to that of my MAMP. When i type command which php, it shows the path to the php version in my MAMP correctly.
When i run php artisan migrate in my terminal, it executes but i get an error
>>SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
chema.tables where table_schema = ecommerce and table_name = migrations)
SQLSTATE[HY000] [2002] Connection refused
Does this mean, i am not connected to the MAMP path correctly or i am still running on a different server on the mac?
PS: When i put of the stop the servers on the MAMP and run php artisan serve as well, the terminal still executes. Is running on a different server somewhere?
Related
I am using Laravel + Docker and I have a container for Redis. But when I run locally php artisan list then I get this error. I want to run this command locally (not in container), I already did composer install locally.
The reason I want to do this on my local machine is so that I could run other artisan commands on my machine (like create a new controller or model). It also helps with intelisense.
$ php artisan list
Predis\Connection\ConnectionException
php_network_getaddresses: getaddrinfo failed: No such host is known. [tcp://myapp-redis-server:6379]
If I change it to localhost, I get a different error REDIS_HOST=localhost
$ php artisan list
Predis\Connection\ConnectionException
No connection could be made because the target machine actively refused it. [tcp://localhost:6379]
I tried laravel dusk on Laravel Framework 5.5.38 by following this https://laravel.com/docs/5.5/dusk
My environment is on windows WSL running Ubuntu 16.04
I tried this
composer require --dev laravel/dusk:"^2.0"
php artisan dusk:install
php artisan dusk
and I got this on the last one
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["--disable-gpu","--headless"]}}}
Failed to connect to localhost port 9515: Connection refused
my url on local is http://crateclub.test
Does anyone encounter similar to this?
I ran into the same error while attempting to run php-webdriver with Windows WSL running Ubuntu inside of a VS Code terminal.
My fix was to switch my execution environment to PowerShell (in external Windows Terminal) and everything started working. You may need to re-install some tools such as PHP CLI and Composer, but this worked for me.
I am running Laravel 5 with PHP 7.0.6. When I run the php artisan update command, I get the following error:
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
This is obviously database related. This happens on a production machine I have as well as local environment. My site is working in both environments.
Does anyone understand this error? Thanks.
You are missing the PHP-CLI database extension. Your site does work because your server is using the PHP-FPM (where you have the PHP extention of your database installed). But when you run php artisan migrate command you are actually executing it on the PHP-CLI.
This question has already been asked multiple times, however I can't seem to get it to work anyway.
I am trying to migrate a migration I just created with laravel to my freshly created database. However, everytime I type in php artisan migrate I'm getting the above error
PDOException SQLSTATE[HY000] [2002] No such file or directory
What I have done is the following:
Create a database and a database user
CREATE DATABASE openletter CHARACTER SET utf8;
CREATE USER 'openletter'#'%' IDENTIFIED BY 'secret';
GRANT ALL PRIVILEGES ON openletter.* TO 'openletter'#'%';
Add these configs to the .env
DB_HOST=localhost
DB_DATABASE=openletter
DB_USERNAME=openletter
DB_PASSWORD=secret
Creating the migration
php artisan make:migration create_letters_table --create=letters
Migrating the migration
php artisan migrate
Then, the above listed error came.
What I tried
Restart the MySQL Service: vagrant ssh && sudo service mysqld restart
Reloading Homestead/Vagrant: vagrant reload --provision
Setting the database config in config/database.php
Many people telling others to link the mysql socket, but those people are refferencing MAMP or XAMPP or sth. else. I'm however using Homestead
What could also be the problem?
Ok guys, I fixed the issue. I'm an idiot and should be ashamed. The reason it didn't work, was because I wasn't in my vagrant machine.
After doing vagrant ssh navigating to my project cd work/OpenLetter and doing php artisan migrate it worked of course.
I am setting up my first data base using XAMPP. I followed the steps from
dev.mysql.com/tech-resources/articles/mysql_intro.html
but as I try to connect to mysqlserver by typing "mysql -u root" into my Terminal I get back an error message:
Phosphoros:~ Arthur$ mysql -u root
-bash: mysql: command not found
Phosphoros:~ Arthur$
I am using Mac OS X 10.7.5.
How can I connect to the server?
Arthur
Your terminal application doesn't know where to locate the mysql program.
For example, if you installed xampp in C:/xampp, you open a command prompt, cd to C:/xampp/mysql/bin and then run your command, which should work now.
Edit: Just remembered you mentioned OSX, regardless, use the same principle. In your terminal, cd to the XAMPP install subfolder which contains the mysql executable app
you have to run the command: mysql -u root in the mysql directory that exists in the /opt/lampp directory.