<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CRIN Trac: Ticket #32: PHP error logs not found</title>
    <link>https://trac.crin.org/trac/ticket/32</link>
    <description>&lt;p&gt;
I'm having issues on newprod, but I can't find PHP error logs. If they are logged, can you please let me know where they are? If they are not logged, can you start logging them on both CRIN2 and CRIN4? Thanks.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CRIN Trac</title>
      <url>https://trac.crin.org/trac/chrome/site/logo.gif</url>
      <link>https://trac.crin.org/trac/ticket/32</link>
    </image>
    <generator>Trac 1.0.2</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Sun, 23 Aug 2015 09:32:08 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/32#comment:1</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/32#comment:1</guid>
      <description>
        &lt;p&gt;
Sorry for the delay in responding to this ticket. By default &lt;tt&gt;php5-fpm&lt;/tt&gt; doesn't generate error logs but I will enable this tomorrow.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 24 Aug 2015 10:59:30 GMT</pubDate>
      <title>hours, status changed; resolution, totalhours set</title>
      <link>https://trac.crin.org/trac/ticket/32#comment:2</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/32#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                set to &lt;em&gt;1&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
I have done this on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;, in &lt;tt&gt;/etc/php5/fpm/pool.d/www.conf&lt;/tt&gt; the following line was added:
&lt;/p&gt;
&lt;pre class="wiki"&gt;php_admin_value[error_log] = /var/log/php/error.log
&lt;/pre&gt;&lt;p&gt;
The directory was created and chowned:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir /var/log/php
chown www-data:www-data /var/log/php
&lt;/pre&gt;&lt;p&gt;
I have set these logs to be rotated daily and for 60 days worth to be kept by creating &lt;tt&gt;/etc/logrotate.d/php5-fpm_errorlog&lt;/tt&gt; containing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;/var/log/php/error.log {
        rotate 60
        daily
        missingok
        notifempty
        compress
        delaycompress
        postrotate
                /usr/lib/php5/php5-fpm-reopenlogs
        endscript
}
&lt;/pre&gt;&lt;p&gt;
&lt;tt&gt;php-fpm&lt;/tt&gt; was restarted:
&lt;/p&gt;
&lt;pre class="wiki"&gt;service php5-fpm restart
&lt;/pre&gt;&lt;p&gt;
I have confirmed that it is working, visit this URL on the dev server: &lt;a class="ext-link" href="https://dev.crin.org/en/library/countries/algeria"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/en/library/countries/algeria&lt;/a&gt; and the following is written to &lt;tt&gt;/var/log/php/error.log&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;[24-Aug-2015 11:47:37 Europe/London] PHP Parse error:  syntax error, unexpected end of file in /var/www/dev/docroot/sites/all/themes/crin/templates/node--country.tpl.php on line 522
&lt;/pre&gt;&lt;p&gt;
There are also errors written to the &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; error log, visit &lt;a class="ext-link" href="https://www.crin.org/sites/default/settings.php"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.crin.org/sites/default/settings.php&lt;/a&gt; and the following line (amoung others) is written to &lt;tt&gt;/var/log/php/error.log&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;[24-Aug-2015 10:55:37 UTC] PHP Notice:  Use of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT' in /var/www/prod/docroot/sites/default/settings.php on line 492
&lt;/pre&gt;&lt;p&gt;
I think that resolves this ticket, feel free to re-open it if there are any problems / issues.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>