By Lex Gabrees
Hi,
I am running a PHP script (CPVlab) on a droplet and when I write something to the DB with it, chances are that I will randomly get a bad gateway 502 message from nginx … With random I mean : at times it works, and then the next time it doesn’t. At the same time, if I’m logged into the shell through putty, it will tell me : network error : software caused connection abort
Below are some logs … could it be a permissions issue ? That would be weird, as it works sometimes …
Anyone have an idea ?
PHP Log seems to be in some loop ?
[05-Oct-2017 07:48:49] NOTICE: Terminating ...
[05-Oct-2017 07:48:49] NOTICE: exiting, bye-bye!
[05-Oct-2017 09:49:07] NOTICE: fpm is running, pid 1476
[05-Oct-2017 09:49:07] NOTICE: ready to handle connections
[05-Oct-2017 09:49:07] NOTICE: systemd monitor interval set to 10000ms
[05-Oct-2017 09:52:36] NOTICE: Terminating ...
[05-Oct-2017 09:52:36] NOTICE: exiting, bye-bye!
[05-Oct-2017 09:52:55] NOTICE: fpm is running, pid 1531
[05-Oct-2017 09:52:55] NOTICE: ready to handle connections
[05-Oct-2017 09:52:55] NOTICE: systemd monitor interval set to 10000ms
[04-Jan-2018 09:18:05] NOTICE: fpm is running, pid 1537
[04-Jan-2018 09:18:05] NOTICE: ready to handle connections
[04-Jan-2018 09:18:05] NOTICE: systemd monitor interval set to 10000ms
[04-Jan-2018 10:10:04] WARNING: [pool www] child 11314 exited on signal 11 (SIGSEGV - core dumped) after 6.989500 seconds from start
[04-Jan-2018 10:10:04] NOTICE: [pool www] child 11317 started
**NGINX error log - File permission issue ? It worked before though **
#1 /var/www/mydomain.com/htdocs/cron-wurfl.php(0): Browscap->updateCache()
#2 {main}
thrown in /var/www/mydomain.com/htdocs/phpbrowscap/Browscap.php on line 0" while reading response header from upstream, client: 87.213.252.89, server: mydomain.com, request: "GET /cron-wurfl.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mydomain.com"
2017/10/05 09:58:54 [error] 1757#0: *13 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'Exception' with message 'Could not write to "/var/www/mydomain.com/htdocs/phpbrowscap/BrowserCache/browscap.ini" (check the permissions of the current/old ini file).' in /var/www/mydomain.com/htdocs/phpbrowscap/Browscap.php:0
Stack trace:
#0 /var/www/mydomain.com/htdocs/phpbrowscap/Browscap.php(0): Browscap->_getRemoteIniFile('http://101secur...', '/var/www/forwar...')
#1 /var/www/mydomain.com/htdocs/cron-wurfl.php(0): Browscap->updateCache()
#2 {main}
thrown in /var/www/mydomain.com/htdocs/phpbrowscap/Browscap.php on line 0" while reading response header from upstream, client: 87.213.252.89, server: mydomain.com, request: "GET /cron-wurfl.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mydomain.com"
2018/01/04 10:10:04 [error] 1945#0: *55 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 87.213.252.89, server: mydomain.com, request: "POST /direct-and-landing-campaign.php?id=3 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mydomain.com", referrer: "http://mydomain.com/direct-and-landing-campaign.php?id=3"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @lexgabrees,
Looking at the logs, it’s seems there are a couple of problems however the main one is related to your application not being able to write to a specific file
Uncaught exception 'Exception' with message 'Could not write to
This can be ofcourse due to wrong permissions of the file or the folder it’s in. Alternatively, it’s possible it’s not able to write to the file due to space issues.
Please check the above possibilities first
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.