{"id":3596,"date":"2016-09-07T06:04:35","date_gmt":"2016-09-07T06:04:35","guid":{"rendered":"http:\/\/www.gubatron.com\/blog\/?p=3596"},"modified":"2017-10-19T03:26:06","modified_gmt":"2017-10-19T03:26:06","slug":"how-to-enable-php-fpm-log-output","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/how-to-enable-php-fpm-log-output\/","title":{"rendered":"HOW TO ENABLE PHP FPM LOG OUTPUT"},"content":{"rendered":"<p>This one had me for the longest time.<\/p>\n<p>If you happen to be running a web server with php-fpm, sometimes you will run across an HTTP 500 error and all you will get will be a blank screen.<\/p>\n<p>You will look at your server&#8217;s error log, your vhost error&#8217;s log and you will see nothing.<\/p>\n<p>At this point you will want to enable logging on php fpm to see what&#8217;s up.<\/p>\n<p>So you will go to your <code>\/etc\/php\/7.0\/fpm\/php-fpm.conf<\/code><\/p>\n<p>you will start searching for &#8220;log&#8221;, and you will come across<br \/>\n<code>error_log = \/var\/log\/php7.0-fpm.log<\/code><br \/>\nyou will <code>tail -f<\/code>\u00a0that log file, and nothing will come up.<\/p>\n<p>you will go back to that config file, you will play with your log levels, and nothing, and that&#8217;s because there&#8217;s this fucking obscure setting on your pool configuration that you&#8217;d never think of.<\/p>\n<p>Let&#8217;s say you&#8217;re using the default <code>www.conf<\/code>\u00a0pool config file (the one sitting at <code>\/etc\/php\/7.0\/fpm\/pool.d\/www.conf<\/code>), open it and look for &#8220;workers&#8221;, you will see this:<\/p>\n<pre><code>; Redirect worker stdout and stderr into main error log. If not set, stdout and\n; stderr will be redirected to \/dev\/null according to FastCGI specs.\n; Note: on highloaded environement, this can cause some delay in the page\n; process time (several ms).\n; Default Value: no\n;catch_workers_output = yes\n<\/code><\/pre>\n<p>uncomment <code>catch_workers_output=yes<\/code><br \/>\nand restart your php-fpm service, tail -f your log and you will see the stack trace you&#8217;re looking for.<\/p>\n<p>You&#8217;re welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This one had me for the longest time. If you happen to be running a web server with php-fpm, sometimes you will run across an HTTP 500 error and all you will get will be a blank screen. You will look at your server&#8217;s error log, your vhost error&#8217;s log and you will see nothing. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[43],"tags":[1182,1532,1531,959,1027],"class_list":["post-3596","post","type-post","status-publish","format-standard","hentry","category-linux","tag-php","tag-php-fpm","tag-php7-0","tag-sysadmin","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-W0","jetpack-related-posts":[{"id":3591,"url":"https:\/\/www.gubatron.com\/blog\/upgrading-your-wordpress-blog-to-php-7-0-on-ubuntu-xenial\/","url_meta":{"origin":3596,"position":0},"title":"Upgrading your wordpress blog to PHP 7.0 on Ubuntu Xenial","author":"gubatron","date":"September 7, 2016","format":false,"excerpt":"If you're about to upgrade your Ubuntu server to 16.04 (Xenial) you might want to take advantage of the new PHP 7.0 which is as fast or more than Facebook's HHVM, or perhaps during the upgrade process a few things may have broken and perhaps that's why you're here Make\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.gubatron.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4038,"url":"https:\/\/www.gubatron.com\/blog\/will-using-nice-20-on-nginx-and-php-fpm-make-my-wordpress-site-go-faster\/","url_meta":{"origin":3596,"position":1},"title":"Will using `nice -20` on nginx and php-fpm make my WordPress site go faster?","author":"gubatron","date":"June 7, 2023","format":false,"excerpt":"The nice command in Unix and Linux systems is used to alter the scheduling priority of processes. A lower nice value means higher priority. However, using nice -20 to set the highest priority for your PHP-FPM and Nginx processes isn't likely to have a significant impact on your WordPress site's\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.gubatron.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2022\/12\/progress_image_100_7fdc7b72-6c19-42f5-affe-d055d02d6f8e.webp?fit=1024%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2022\/12\/progress_image_100_7fdc7b72-6c19-42f5-affe-d055d02d6f8e.webp?fit=1024%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2022\/12\/progress_image_100_7fdc7b72-6c19-42f5-affe-d055d02d6f8e.webp?fit=1024%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2022\/12\/progress_image_100_7fdc7b72-6c19-42f5-affe-d055d02d6f8e.webp?fit=1024%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3517,"url":"https:\/\/www.gubatron.com\/blog\/sysadmin-serve-your-wordpress-cached-pages-with-lighttpd-and-not-php\/","url_meta":{"origin":3596,"position":2},"title":"[SYSADMIN] Serve your WordPress cached pages directly with lighttpd and not PHP","author":"gubatron","date":"June 7, 2016","format":false,"excerpt":"Optimizing Your Wordpress Cache Loads in Lighttpd. If you don't configure your wordpress virtual host properly in lighttpd, your wordpress cache will still make use of PHP. Wouldn't it be nice if all those cached requests were served directy from the webserver as the static files that they are, bypassing\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3899,"url":"https:\/\/www.gubatron.com\/blog\/how-to-suppress-useless-mod_openssl-lighttpd-error-messages-from-var-log-syslog-in-ubuntu\/","url_meta":{"origin":3596,"position":3},"title":"[linux\/ubuntu] How to suppress useless mod_openssl\/lighttpd error messages from appearing in \/var\/log\/syslog","author":"gubatron","date":"August 7, 2020","format":false,"excerpt":"Sometimes you have a bunch of useless errors creating unnecessary disk I\/O on your server, disk I\/O that should be used towards serving your user's requests efficiently. In this case a site running on lighttpd keeps logging several times per second the following message, creating too much noise and making\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.gubatron.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":85,"url":"https:\/\/www.gubatron.com\/blog\/2-programitas-utiles-mientras-desarrollas-en-linux\/","url_meta":{"origin":3596,"position":4},"title":"2 programitas utiles mientras desarrollas en Linux","author":"gubatron","date":"December 29, 2004","format":false,"excerpt":"Para los desarrolladores que utilizan lenguajes de programacion como Perl, o PHP, a continuacion, un programita bien util. Supon que tienes un archivo .php donde tienes definidas un monton de funciones. Y no te acuerdas que funciones estaban ahi, lo mas probable es que tengas que abrir el archivo y\u2026","rel":"","context":"In &quot;Gubatron&quot;","block_context":{"text":"Gubatron","link":"https:\/\/www.gubatron.com\/blog\/category\/gubatron\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3376,"url":"https:\/\/www.gubatron.com\/blog\/what-to-do-when-lighttpd-wont-start-and-wont-give-out-any-error-output\/","url_meta":{"origin":3596,"position":5},"title":"What to do when lighttpd won&#8217;t start and won&#8217;t give out any error output?","author":"gubatron","date":"February 4, 2015","format":false,"excerpt":"So you upgraded your server, or just all of a sudden you try to start lighttpd, it says the server started ok, but you check and there's no lighttpd process. You then go after your error log files, and nothing... what the fuck is happening? try this to attempt to\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=3596"}],"version-history":[{"count":4,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3596\/revisions"}],"predecessor-version":[{"id":3601,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3596\/revisions\/3601"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=3596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=3596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=3596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}