How do I enable php error log on Laravel Homestead - php

I'm using Laravel Homestead to develop a laravel 5.2 site.
It's working fine, but recently I started getting the utterly useless Laravel / nginx 502 Bad Gateway error, which could mean anything from a php error to a server misconfiguration.
I'm looking in the homestead box's /etc/php5/fpm/php-fpm.conf and php error logging is active and is set to log to error_log = /var/log/php5-fpm.log
This log file is empty however, and I can't find any info on how to enable basic PHP error logging.
The basic laravel log at storage/logs/laravel.log is getting written to but it has no information on these 502 errors.
From /var/log/nginx/myapp.log file:
2017/03/21 17:50:42 [error] 5239#0: *12 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.10.1, server: replication-interface.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "myapp.app"

Related

Laravel Forge download limit (1024MB)

When trying to download file larger than 1024MB from server using PHP "return response()->download(...);" it doesn't download more than 1024MB.
When downloading from public_html not via PHP, larger files can be downloaded.
Nginix error:
2016/09/15 13:23:58 [error] 5801#5801: *198201 readv() failed (104: Connection reset by peer) while reading upstream, client: xx.xx.xx.xx, server: xxxxxx.com, request: "GET /test HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "xxxxxx.com"
Using: Laravel Forge, Laravel 5.1, Nginx, PHP 7.
Increasing in Nginx fastcgi_max_temp_file_size solved the problem.

ZMQ sockets working on dev, not working on production

I've been following this tutorial and it all seems to be working on my local machine but as soon as I try it on a production server, the page where I send the new blog post, as soon as it gets to the $socket->connect("tcp://localhost:5555"); part it returns a 500/502 error.
With apache2 and PHP working on FastCGI the apache log says:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://website/_test/send.php
And if I switch it to an Apache module the error is following:
upstream prematurely closed connection while reading response header from upstream
There is nothing in the php error log file, only in the apache log.
EDIT1: Checked sockets with a script from https://www.websocket.org/echo.html "Creating your own test" section.
It responded with
CONNECTED
SENT: WebSocket rocks
RESPONSE: [0,"166422729657a4668eedc90747239488",1,"Ratchet\/0.3.5"]
DISCONNECTED
EDIT2: I'm thinking it might be something with nginx. From the looks of it our production server uses apache on the inside but then uses nginx for the outside connections (I wasn't the one who set it up, hence the guesses).
EDIT3: Log from proxy_error_log:
2016/08/05 14:27:22 [error] 19214#0: *155952 upstream prematurely closed connection while reading response header from upstream, client: 217.**.**.***, server: my.domain.name, request: "POST /_socket/send.php HTTP/1.1", upstream: "http://78.***.***.**:7080/_socket/send.php", host: "my.domain.name", referrer: "http://my.domain.name/_test/chat.php"

Sylius: 504 Gateway Time-out on dev environment with Standard-Edition

I've followed the installation steps here: http://docs.sylius.org/en/latest/book/installation.html
Everything it's ok until I don't try to access the /app_dev.php.
I'm running it on Vagrant v1.8.1 with a Ubuntu 14.04 box, memory=1024 and cpus=2. The physical host is a MacbookPro 10.11.3 (i5 2.7 GHz, Ram 8 Gb).
Even tried to install apcu extension and changing the memory_limit in php.ini file to 512 Mb but nothing changes.
Nginx logs says:
2016/03/16 11:31:06 [error] 1292#0: *1 upstream timed out (110:
Connection timed out) while reading response header from upstream,
client: 192.168.10.1, server: test.dev, request: "GET /app_dev.php/
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "test.dev",
referrer: "http://test.dev/app_dev.php/login"
The application log doesn't show any error. Also tried to reprovision the vm and install Sylius from start but I get always the same behavior.
I think it's related to the host configuration but don't know where to start.
After many attempt with different box configuration I finally managed to make Sylius working. Just removed and reinstalled plugin vagrant-bindfs.
It's still really slow and use much memory (about 60MB), I will dig more on NFS configuration for Vagrant-OSX and then I will update this answer.

PHP-FPM Xdebug causes SIGSEGV

Enabling Xdebug on nginx server with php-fpm causes SIGSEGV error logged in /var/log/nginx/error.log:
2015/07/26 20:30:37 [error] 28452#28452: *326 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.50.1, server: mydomain.dev, request: "POST /admin/soap/add/95 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mydomain.dev", referrer: "http://mydomain.dev/admin/soap/add/95"
When I disable Xdebug errors are gone.
Script which is causing this error sends SOAP request to the external service.
In my opinion this might be some kind of buggy configuration e.g. exceeding max connection number or something like this, but I have no idea how to find it.
The server which I'm working on is Vagrant box https://github.com/Varying-Vagrant-Vagrants/VVV.

phpMyadmin error 2002 LEMP Stack

I'm using a RedHat Linux Web and DB server. Have PHPMyadmin 4.0.10.2-2 installed on web server w/ PHP 5.3.3 and Nginx 1.4.4. Connecting to the db server, Percona 5.5.32.
I can't log into PHPMyAdmin with mysql credentials anymore. BUT I can log in to mysql via cli and mysql workbench with those credentials.
Modified my /etc/phpMyAdmin/config.inc.php to point to the db server which reside on the same subnet. Also specified the root user and other use within this file. Confirmed I could still ping servers and access mysql via web server.
Restarted all services.
Did look in the error logs (/var/log/nginx/phpMyAdmin/error.log) and get this... "2014/09/25 18:36:48 [error] 6457#0: *543 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 67.136.101.122, server: phpmyadmin.domain.com, request: "GET /index.php?token=4086842d92d66bb2f971ef2228c29acf HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "phpmyadmin.domain.com", referrer: "https://phpmyadmin.domain.com/index.php?token=4086842d92d66bb2f971ef2228c29acf"
Things were working just fine yesterday. Did an yum update this morning, which is the last change to the server.
Found the resolution. After many hours, the /etc/phpMyAdmin directory group permission had to be set to nginx.

Categories