Closed (fixed)
Project:
Quickstart: Prebuilt Drupal Development Environment
Component:
Image Build
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 May 2012 at 18:52 UTC
Updated:
22 May 2012 at 22:30 UTC
Not sure what I do wrong, but I cannot get notices displaying in /var/log/php-error.log
In /etc/php5/apache2/php.ini there is error_reporting = E_ALL and I am able to get notices displayed on the page itself (e.g. for a test.php page containing $x=$y; ) ... but nothing appears in the log.
What am I missing?
Comments
Comment #1
vacilando commentedIf I edit /etc/apache2/sites-available/MYSITE.dev, add something like php_value error_log /home/quickstart/websites/logs2/php.error.log, making sure that php.error.log is writable, then this particular log gets populated.
But why do I have to do that? I would expect the default PHP error log (/var/log/php-error.log) should collect PHP errors in absence of more specific error logs...?
Comment #2
vacilando commentedAll right - I have found that /var/log/php-error.log was not writable.
I issued
sudo chmod 777 /var/log/php-error.logand errors started to appear there.Could you please look into the reasons and fix as necessary for the next release?
Comment #3
mike stewart commentedI beleive something in your setup changes from the original image.
You fix, although common when searching google, is dangerous, ESPECIALLY the last 7 -- which means "world" has full read/write/execute. Typically, 740 for files is plenty -- in some cases you might need (suchs as files folder 770=folder or 760=files in the folder)
I suspect the orginial problem was your user/groups were accidentally changed. check details in the folder by using the ll command alias (lowercase LL) -- and verify user:group. To fix, you'd use something like:
sudo chmod www-data:www-data /var/log/php-error.log
syntax: sudo chmod user:group [PATH]
Edit: If someone knows I'm incorrect, and permissions on the file are wrong out-of-the-box -- please feel free to re-open this issue.
Comment #4
vacilando commentedI beg to disagree.
Basically the question was whether a fresh Quickstart install could write to php-error.log
Now, on a different machine and different Quickstart installation, I have just witnessed the same problem again -- no entries in that log file.
The properties were as follows:
-rw-rw-r-- 1 root root 12423 2012-04-17 16:33 php-error.log
I tried chmod 740, still no luck. Tried 766 -- and the logs started to appear.
I am pretty sure I did not chmod or chown this file or its folder before, at least not knowingly.
[BTW, notably, the properties for an Apache access log, which works, have a different group: -rw-r----- 1 root adm 334501 2012-05-07 11:50 access.log]
Comment #5
Sean Buscay commentedHi all.
I tested the following:
660 was the tightest I could lock it down and still get the error reports showing up. Michael Cole may have a better answer. Otherwise, fyi, the above works.
Comment #6
mike stewart commentedAh, that makes sense. when I suggested 760 on a file ... I musta been high. :-P It would have make it executable ... dangerous.
I think @Vacilando was suggesting the the permissions on the file is incorrect on the vanilla image. I'm not sure... and haven't had time to test. However, I did test the new image setup, and as a default it is 660.
Since we've no plans to update the old 11.04 image, and the new image will work, I'm closing this issue. Here's the fix on the 7.x-2.x branch
Comment #7
vacilando commentedThanks, Sean & Mike. We have a fix for now and you have confirmed that perms will be all right in Quickstart 2, so that's all right for me.
Comment #8
Sean Buscay commentedHi Mike.
Just a note. It sounds like it all works in 2.0 so it may not be an issue.
However, for the fix, note I chowned to: root:www-data
sudo chown root:www-data /var/log/php-error.log
That allowed www-data as the group to write to the file with the 660. The second 6 being the www-data group.
I'm not sure -rw-rw---- 1 root adm 10186 May 8 14:49 error.log gives www-data access to write to the error log unless if the apache user is in the adm group.
Please know, I'm not a linux permissions expert though or anything.
Comment #9
mike stewart commentedThe 10186 above, is the file size. so, ya, there were some errors that were written. It works