问题
I'm using Laravel. When I dd($request->all()) that the data inside it involves file (.mp3 file). It returns the error:
[2019-03-16 15:44:12] local.ERROR: stream_socket_sendto(): Connection refused {"exception":"[object] (RuntimeException(code: 0): stream_socket_sendto(): Connection refused at /vendor/symfony/var-dumper/Server/Connection.php:63
Can this be a problem with php-fpm ? If I run php artisan serve, this does not happen, and if I run php artisan dump server it does not happen either.
Any ideas??
回答1:
Finally I figured out. The problem was that the upload_max_filesize
in the php.ini
of the php-fpm, it was only 2M, after increasing to 100M it works.
So you must change this value in:
/etc/php/7.2/fpm/php.ini
/etc/php/7.2/cli/php.ini
upload_max_filesize=100M
And ofcourse this value must be the same also
upload_max_filesize=100M
回答2:
I don't know nginx(although only the structure are different) but in apache 2.4.6 I added this to /etc/httpd/conf/httpd.conf
:
DocumentRoot /home/yoursite/public_html/public
ProxyPassMatch "^/(.*\.php)$" "unix:/run/php-fpm/www.sock|fcgi://localhost:9000/public/index.php"
and in /etc/php-fpm.d
I have:
listen = /run/php-fpm/www.sock
chroot = /home/yoursite/public_html
chdir = /public
and lastly don't forget to restart both apache and php-fpm each time you change something in httpd.conf
or php-fpm.d
files. Again because I was using apache I had these commands in centos 7:
systemctl restart httpd && systemctl restart php-fpm
来源:https://stackoverflow.com/questions/55203433/stream-socket-sendto-connection-refused-laravel-5-7-dump-server