How to find webserver or OC logfile / enable php logfile

Here we try to answer typical questions
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

How to find webserver or OC logfile / enable php logfile

Postby RealRancor » Fri Dec 28, 2012 9:36 am

Most times it's very useful to have a look at the webserver logfile, the own logfile of ownCloud or the logfile of php. On linux you can find (depending on your used distro) at this locations:

ownCloud
/path/to/owncloud/data/owncloud.log

IMPORTANT NOTE:
Please set DEBUG to true (for 8.1 and below):
https://github.com/owncloud/core/blob/v ... .php#L3-L5
or debug => true (for oC 8.2+):
https://github.com/owncloud/core/blob/v ... 1160-L1166

and the loglevel to 0:
https://github.com/owncloud/core/blob/v ... #L153-L154

in your config.php (just add the two directives above) to get more logging output.

Apache
/var/log/apache2/error.log
/var/log/apache2/access.log

NginX
/var/log/nginx/error.log
/var/log/nginx/access.log

lighttpd
/var/log/lighttpd/error.log
/var/log/lighttpd/access.log

PHP
Source of this info: http://davidwinter.me/articles/2009/07/ ... r-logging/

The plain PHP installations shows error instead of logging them. To enable the error log of php you have to edit your php.ini (e.g. /etc/php5/apache2/php.ini) and set these options:

display_errors = off
log_errors = on
error_log = /var/log/php-errors.log


Additional you have to create this logfile with the proper permissions:

sudo touch /var/log/php-errors.log
sudo chown www-data:www-data /var/log/php-errors.log


After this edits you have to restart your webserver and/or your php fcgi process.
*gone*

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Find webserver logfile / enable php logfile

Postby RandolphCarter » Mon Jan 07, 2013 1:01 pm

What I found so far for IIS:
Don't have much experience with IIS, though. If anybody got other or additional information, please share!

User avatar
chassetheater
Helpful Elf
Posts: 163
Joined: Tue Feb 05, 2013 12:44 pm
ownCloud version: 8.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3
Contact:

Re: How to find webserver logfile / enable php logfile

Postby chassetheater » Fri Mar 01, 2013 10:29 am

RandolphCarter wrote:What I found so far for IIS:
Don't have much experience with IIS, though. If anybody got other or additional information, please share!

The PHP logfile can also be handy on a Windows environment. You can find this at %SystemDrive%\Windows\temp\php-errors.log. This is the standard location, but you can change this in the php.ini file. Search for error_log (line 922).
You can use the PHP error log instruction from the first post. The permissions have to be configured differently, but that is not too difficult.

red13
Newbie
Posts: 1
Joined: Tue Jun 04, 2013 8:48 am
ownCloud version: 4.0.7
Webserver: Apache
Database: MySQL
OS: Windows Desktop
PHP version: 5

Re: How to find webserver logfile / enable php logfile

Postby red13 » Tue Jun 04, 2013 8:50 am

chassetheater wrote:
RandolphCarter wrote:What I found so far for IIS:
Don't have much experience with IIS, though. If anybody got other or additional information, please share!

The PHP logfile can also be handy on a Windows environment. You can find this at %SystemDrive%\Windows\temp\php-errors.log. This is the standard location, but you can change this in the php.ini file. Search for error_log (line 922).
You can use the PHP error log instruction from the first post. The permissions have to be configured differently, but that is not too difficult.


I have looked for php-errors.log in %SystemDrive%\Windows\temp as you suggested but it's not there.

Could it be in another folder or perhaps I have to create it manually?


__________________________________________________________________________________________
Cloud: centralize your information and access it from anywhere in the world on any computer. Free hosting
Last edited by red13 on Sun Jun 23, 2013 3:32 pm, edited 1 time in total.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to find webserver logfile / enable php logfile

Postby RealRancor » Tue Jun 04, 2013 8:54 am

Hi,

you have to enable it in your php.ini like described above to get this logfile. If you have already enabled the logging of php the php-errors.log is only created when there is anything to log in in.
*gone*

Sarah3481
Newbie
Posts: 1
Joined: Sat Apr 12, 2014 11:33 am

Re: How to find webserver logfile / enable php logfile

Postby Sarah3481 » Sat Apr 12, 2014 11:37 am

Rancor wrote:Hi,

you have to enable it in your php.ini like described above to get this logfile. If you have already enabled the logging of php the php-errors.log is only created when there is anything to log in in.


Thanks a million Rancor i was pulling my hair out with the exact same problem but now i finally have it sorted at last! :D

Thanks again,
cpnm.uskondosyokai.comjohnsonvalleyrallyx.comcocktailbarka.comxreccorp.comaccredited-tpi.comelectricallifecyclesolutions.comaberdeenseals.co.ukniwebsports.comzendogcafe.comanimeanarchy.netkittelsonforcongress.comhydragroupltd.com
Sarah
Last edited by Sarah3481 on Tue Aug 04, 2015 7:00 pm, edited 3 times in total.

maplewang
Newbie
Posts: 3
Joined: Sun Nov 16, 2014 4:53 am

Re: How to find webserver or OC logfile / enable php logfile

Postby maplewang » Sun Nov 16, 2014 5:54 am

In version 7 I have this log problem, it

touch(): Unable to create file owncloud.log because Permission denied at /var/www/owncloud/lib/private/log/owncloud.php#49

I set my Data at /var/Data, so the defaulLogFile is /var/data/owncloud.log

I hva set its ownership, but still give errors.

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: How to find webserver or OC logfile / enable php logfile

Postby tflidd » Sun Nov 16, 2014 11:36 am

Can you post

Code: Select all

ls -la /var/data
? Please note that /var/Data is different from /var/data.

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: How to find webserver or OC logfile / enable php logfile

Postby RandolphCarter » Wed Apr 01, 2015 1:45 pm

In version 7 I have this log problem, it

touch(): Unable to create file owncloud.log because Permission denied at /var/www/owncloud/lib/private/log/owncloud.php#49


Is this the first entry in your logfile? Then this is a known problem, see here: https://github.com/owncloud/core/issues/12893, and isn't critical at all.

Otherwise please tell us where you see it. But in a separate thread, this only marginally has to do with the original topic here.

optimusprime
Newbie
Posts: 6
Joined: Wed Oct 14, 2015 5:07 pm
ownCloud version: 4.0.8
Webserver: IIS
Database: MySQL
OS: Linux
PHP version: PHP 5

Re: How to find webserver or OC logfile / enable php logfile

Postby optimusprime » Fri Oct 16, 2015 2:14 pm

maplewang wrote:In version 7 I have this log problem, it

touch(): Unable to create file owncloud.log because Permission denied at /var/www/owncloud/lib/private/log/owncloud.php#49

I set my Data at /var/Data, so the defaulLogFile is /var/data/owncloud.log

I hva set its ownership, but still give errors.


I've heard of similar problems, think one of my colleagues had this problem, will ask him.


  • Similar Topics
    Replies
    Views
    Last post

Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 1 guest