Somik's Home

Server admins cheat codes

Category: PHP

  • PHP-FPM Restart Upon Crash

    PHP-FPM service, when running as socket, seems to crash making Nginx output errors and users frustated. This is a simple fix to bypass the issue with auto restarting the php upon crash. Although it is recommended to see why the crash occurs in first place and fix that first.

    Read More

  • Nginx + PHP continious output

    Some times we requrire the page to display partial content, such as progress while the PHP is still working in background. In apache, disabling output buffering works fine, however for nginx, the following code need to be added on top of any PHP script (before output stats).

    Read More

  • PHP IP to Country Script

    This is a simple script to translate IP to country. It is usefull when you want to know where your traffic is coming from or perform specific actions to traffic from specific countries. Do take note that users using proxies or VPN can circumvent this and give a false country.

    Read More

  • Server Status Display (Modified)

    This will show a simple status of your server including CPU, RAM and disk usage, as well as status of ports you are monitoring. The original script by lfiore has been highly optimized and modified by me. You need to have PHP and any httpd agent (apache or lighttpd or nginx) to be able to […]

    Read More

  • First Post

    Simple beginnings.

    Read More