Zen Cart Logo
Forums / General Questions / my cPanel site won't record log files

my cPanel site won't record log files

Views: 4,215

Results 1 to 20 of 26
19 Dec 2016, 8:02 AM
#1
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

my cPanel site won't record log files

Hi all,

I am using cPanel EA4 (EasyApache) on Godaddy VPS
It using PHP-FPM with PHP 5.6.x

I had installed a new ZC 1.5.5b with skin.

But now I discovered that look like cPanel's EA4 work different with EA3 by default setting ...

On my other older VPS that using EA3
Any Zen Cart have error will save a files in /logs this position...

But EA4 look like not work this way, it log at the apache error log
for example
my web site there
/public_html/zencart155b
so on general any PHP error log that make by ZC will auto save at
/public_html/zencart155b/logs
But my EA4 haven't any log on above folder ....
The logs is Outside of the public_html, but at it root have a logs folder
/logs/abc_com.php.error.log

Do anyone that using cPanel with EasyApache4 can share what setting wrong on the Zen Cart?

Since If can't fix this, it will make me debug very hard!

Thank

19 Dec 2016, 8:10 AM
#2
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

And I also compare with Zen Cart 1.5.4
It have a line at /includes/configure.php
//the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
define('DIR_FS_LOGS', '/home/abc/public_html/zc154/logs');

but any fresh install ZC 1.5.5b
Open /includes/configure.php
HAVEN't any line same as above 1.5.4 do ....

Do starting from ZC 1.5.5 up changed something that work on before?

19 Dec 2016, 8:52 AM
#3
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

I add this to /includes/configure.php
define('DIR_FS_LOGS', '/home/abc/public_html/abc/logs');

It still NOT WORK ....

How to make ZC 1.5.5b logs as 1.5.4 before?

19 Dec 2016, 10:50 AM
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: my cPanel site won't record log files

explorer1979:

And I also compare with Zen Cart 1.5.4
It have a line at /includes/configure.php
//the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
define('DIR_FS_LOGS', '/home/abc/public_html/zc154/logs');

but any fresh install ZC 1.5.5b
Open /includes/configure.php
HAVEN't any line same as above 1.5.4 do ....

Do starting from ZC 1.5.5 up changed something that work on before?

Sounds like things are a little out of whack with your setup.

cPanel and EA4 have nothing to do with where Zen Cart stores its log files. If you look at the configure.php file for 1.5.4 it would probably look something like:

//the following path is a COMPLETE path to the /logs/ folder  eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
define('DIR_FS_LOGS', DIR_FS_CATALOG . '/logs');

Things were change in the configure.php file starting with 1.5.5 by taking some things out.

define('DIR_FS_LOGS', DIR_FS_CATALOG . '/logs');

is now found in the /includes/defined_paths.php file.

Remember also, if there are no errors to record/report then none will be shown.

19 Dec 2016, 1:31 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: my cPanel site won't record log files

It almost sounds like your host has disabled the capability for Zen Cart to change (via the PHP function ini_set) the error-reporting location.

Log into your Zen Cart admin, click Tools->Server/Version Information and search for disable_functions. Is there something other than no value displayed for that setting?

19 Dec 2016, 2:01 PM
#6
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Dear lat9,

Yes, something like this on zc155b
disable_functions

exec,passthru,shell_exec,system exec,passthru,shell_exec,system

How I test error?
For example
If I after instlled
rename some file like this one

/includes/templates/template_default/common/html_header.php
to
/includes/templates/template_default/common/html_header.php(xyz)

This will make the front end be blank white page on ZC 154 or 155b, and general will have a logs files under your installed zen cart folder...

But I also try same server install a fresh new ZC 1.5.4 on it, same result, no logs on the zen carts folder's logs postition.
On general the Zen Cart error logs on all cPanel WHM (60.0.28) will be like this
/home/username/public_html/zc154/logs
But nothing there

So I am 100% sure my server have something wrong.

Guess what the error logs files?
it is on this path
/home/username/logs/username_com.php.error.log

I can see the eRROR
PHP Fatal error: require(): Failed opening required 'includes/templates/template_default/common/html_header.php' (include_path='.:/opt/cpanel/ea-php55/root/usr/share/pear') in /home/username/public_html/test154/index.php on line 43

but if all thing right, above text and log will be there
/home/username/public_html/zc154/logs/xxx_logs
not on
/home/username/logs/username_com.php.error.log

Hope someone who using cPanel WHM can share how to fix this

Thank you.

19 Dec 2016, 2:06 PM
#7
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Plus my fresh new install ZC 1.5.4 it have error
I can't access the ZC 154 backend

PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) /home/username/public_html/test154/adminj/includes/classes/class.admin.zcObserverLogWriterDatabase.php on line 90 <== in /home/username/public_html/test154/includes/classes/db/mysql/query_factory.php on line 155

My Server Enviroment
Godaddy 2G VPS
CentOS 6 with cPanel WHM
While I am setting up by using EasyApache 4 with the ALL PHP Option Profile
Which will install Apache 2.4, PHP 5.5.38, 5.6, 7.0 (Can let you choose using which one PHP for one of the username base domain), I choosed PHP 5.5.x
with Enable PHP-FPM (But global PHP Handle is suphp mode)
MySQL 5.6.34

19 Dec 2016, 2:16 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: my cPanel site won't record log files

explorer1979:

Plus my fresh new install ZC 1.5.4 it have error
I can't access the ZC 154 backend

PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) /home/username/public_html/test154/adminj/includes/classes/class.admin.zcObserverLogWriterDatabase.php on line 90 <== in /home/username/public_html/test154/includes/classes/db/mysql/query_factory.php on line 155

My Server Enviroment
Godaddy 2G VPS
CentOS 6 with cPanel WHM
While I am setting up by using EasyApache 4 with the ALL PHP Option Profile
Which will install Apache 2.4, PHP 5.5.38, 5.6, 7.0 (Can let you choose using which one PHP for one of the username base domain), I choosed PHP 5.5.x
with Enable PHP-FPM (But global PHP Handle is suphp mode)
MySQL 5.6.34
See this Zen Cart posting in regards to the highlighted message; is there any reason that you're installing ZC1.5.4 instead of 1.5.5b?

19 Dec 2016, 2:21 PM
#9
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Dear lat9,

No reason for ZC154, Because I am install it to test the Server what is wrong on the logs files that ZC 155b also not work.

But once installed that see this error on access the ZC 154 back end ....

Actually, I just want to fix the error log problems why not work under Zen Cart's path. Hope anyone that who can help for this. Or share how to setting the EasyApache4 by the Profile?

19 Dec 2016, 2:31 PM
#10
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

lat9:

It almost sounds like your host has disabled the capability for Zen Cart to change (via the PHP function ini_set) the error-reporting location.

Log into your Zen Cart admin, click Tools->Server/Version Information and search for disable_functions. Is there something other than no value displayed for that setting?

Dear lat9,

Do you know how to fix this? I have full root on this VPS if need change something the cPanel WHM build-in haven't
But ... EasyApache4 is a bit complex, since it install multi-PHP version on the same machine by different path etc ... it is why I said it can let me choose using which PHP version to run (for example, domainA.com (user A) run by PHP5.5, domainB.com (user B) run by PHP7)
It look like each user have setting too (I am not too sure) ... it is why I ask there.

Other old server that I am using by Godaddy are long year ago, they using EasyApache3 to complication the environment that only one PHP version, and default setting can make the logs run ...

I am try fix this few hour still no lucky :huh:

19 Dec 2016, 3:27 PM
#11
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: my cPanel site won't record log files

You could also create a .php file (name of your choice) containing:

<?php phpinfo (); 

Place that file in your Zen Cart's root folder, then access that by going to https://www.yoursite.com/the_file_name.php. That will output the information that you could also access via the admin.

Let me know what the disable_functions setting is.

19 Dec 2016, 3:36 PM
#12
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

lat9:

You could also create a .php file (name of your choice) containing:

<?php phpinfo (); ``` > Place that file in your Zen Cart's root folder, then access that by going to [www.yoursite.com/the\_file\_name.php](http://www.yoursite.com/the_file_name.php). That will output the information that you could also access via the admin. > > Let me know what the **disable_functions** setting is. Dear lat9, disable_functions | | | | | --- | --- | --- | | | exec,passthru,shell_exec,system | exec,passthru,shell_exec,system | left is local value, right is master value
19 Dec 2016, 3:59 PM
#13
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: my cPanel site won't record log files

Hmm, not what I expected! Let's try another:

<?php ini_set ('error_reporting', -1); 

If you place the above code into that PHP file and run it, do you receive any error output?

20 Dec 2016, 1:21 AM
#14
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

lat9:

Hmm, not what I expected! Let's try another:

<?php ini_set ('error_reporting', -1); ``` > If you place the above code into that PHP file and run it, do you receive any error output? Dear lat9, Follow your php NOthing output there
20 Dec 2016, 1:36 AM
#15
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Attachment 16843

Please check your PM
Since this is public open server, I don't want to point the URL that let you can access the phpinfo();
Your PM include a FULL URL can see it output

20 Dec 2016, 2:38 AM
#17
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Here are the EasyApache4 Advanced PHP Editor PHP.ini

;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.


; display_errors
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; error_reporting
;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development Value: E_ALL
;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

; html_errors
;   Default Value: On
;   Development Value: On
;   Production value: On

; log_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: On

; max_input_time
;   Default Value: -1 (Unlimited)
;   Development Value: 60 (60 seconds)
;   Production Value: 60 (60 seconds)

; output_buffering
;   Default Value: Off
;   Development Value: 4096
;   Production Value: 4096

; register_argc_argv
;   Default Value: On
;   Development Value: Off
;   Production Value: Off

; request_order
;   Default Value: None
;   Development Value: "GP"
;   Production Value: "GP"

; session.bug_compat_42
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; session.bug_compat_warn
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; session.gc_divisor
;   Default Value: 100
;   Development Value: 1000
;   Production Value: 1000

; session.hash_bits_per_character
;   Default Value: 4
;   Development Value: 5
;   Production Value: 5

; short_open_tag
;   Default Value: On
;   Development Value: Off
;   Production Value: Off

; track_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; url_rewriter.tags
;   Default Value: "a=href,area=href,frame=src,form=,fieldset="
;   Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
;   Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"

; variables_order
;   Default Value: "EGPCS"
;   Development Value: "GPCS"
;   Production Value: "GPCS"
20 Dec 2016, 2:43 AM
#18
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-functions
disable_functions =

; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
disable_classes =

error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off

20 Dec 2016, 2:48 AM
#19
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: my cPanel site won't record log files

Attachment 16844

Attachment 16845

Attachment 16846

20 Dec 2016, 3:57 AM
#20
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: my cPanel site won't record log files

explorer1979:

Here are the EasyApache4 Advanced PHP Editor PHP.ini

;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.

; display_errors
; Default Value: On
; Development Value: On
; Production Value: Off

; display_startup_errors
; Default Value: Off
; Development Value: On
; Production Value: Off

; error_reporting
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

; html_errors
; Default Value: On
; Development Value: On
; Production value: On

; log_errors
; Default Value: Off
; Development Value: On
; Production Value: On

; max_input_time
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)

; output_buffering
; Default Value: Off
; Development Value: 4096
; Production Value: 4096

; register_argc_argv
; Default Value: On
; Development Value: Off
; Production Value: Off

; request_order
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"

; session.bug_compat_42
; Default Value: On
; Development Value: On
; Production Value: Off

; session.bug_compat_warn
; Default Value: On
; Development Value: On
; Production Value: Off

; session.gc_divisor
; Default Value: 100
; Development Value: 1000
; Production Value: 1000

; session.hash_bits_per_character
; Default Value: 4
; Development Value: 5
; Production Value: 5

; short_open_tag
; Default Value: On
; Development Value: Off
; Production Value: Off

; track_errors
; Default Value: Off
; Development Value: On
; Production Value: Off

; url_rewriter.tags
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"

; variables_order
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"

If these truly are the settings in the file then understand that all of them take the default (instead of the Production Value) because they are all commented out (beginning with a semi-colon (;)).

It may seem that in particular the ones related to showing instead of logging errors may be a reason why your logs are not generated.  Display of errors can be a security risk where an error could be forced to occur and the result presented to the visitor.