Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Linux/Unix Server / Error logs not being written

Error logs not being written

Started by jeking on 25 Mar 2016, 1:42 PM · Views: 3,736

Results 1 to 17 of 17
25 Mar 2016, 1:42 PM
#1
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #1 by jeking

I'm working on an upgrade and getting blank pages. When I look in my logs folder, there are no errors. When I enable STRICT_ERROR_REPORTING, I do see the errors on the screen.

My logs folder is writable and I have not made any changes to either configure.php file relating to log files or folders.

Jim
Wheaton Website Services

25 Mar 2016, 2:22 PM
#2
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #2 by jeking

I checked with the host. They did recently disable PHP functions:
show_source, system, shell_exec, passthru, exec, popen, proc_open, ini_set

Are any of these require for log files to be written?

Jim
Wheaton Website Services

25 Mar 2016, 3:22 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

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

Post #3 by mc12345678

jeking:

I'm working on an upgrade and getting blank pages. When I look in my logs folder, there are no errors. When I enable STRICT_ERROR_REPORTING, I do see the errors on the screen.

My logs folder is writable and I have not made any changes to either configure.php file relating to log files or folders.

Writeable? What permissions specifically?

No changes to configure.php files? So, what regarding DIR_FS_LOGS is present if anything?

What makes you think an error is occurring? Any indication that the error is generated before/after zc error logging has been initiated?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

25 Mar 2016, 3:26 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

jeking:

I checked with the host. They did recently disable PHP functions:
show_source, system, shell_exec, passthru, exec, popen, proc_open, ini_set

Are any of these require for log files to be written?
No. Those are not required for log writing.

Logs are written to /logs/ if the folder is writable (by the user account on the server which is running PHP/Apache), and if the enable_error_logging.php file is present in the extra_configures folder in both admin and catalog.

The DIR_FS_LOGS constant defaults to pointing to the /logs/ folder, and is no longer set in the configure.php file unless you've set your own define for it there for the purpose of overriding the default.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Mar 2016, 5:16 PM
#5
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #5 by jeking

The folder is 755 and I also tried 777. The folder has the same ownership as all other folders.

enable_error_logging.php is present in both the admin and catalog folders.

Here's an example:
http://wheatonwebsiteservices dot net/zen155/graphics-cards-c-1_4/matrox-g400-32mb-p-2

Shouldn't this error be logged?

Jim
Wheaton Website Services

25 Mar 2016, 5:41 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

Yes, I would expect it to be logged.

Maybe something about the server's configuration is denying application-level overrides to php directives.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Mar 2016, 5:52 PM
#7
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #7 by jeking

While the PHP directives may not be needed for error logging, removing them solved the problem. I'm getting my error logs again.

It could be a server config that needs some in some way.

Jim
Wheaton Website Services

25 Mar 2016, 6:21 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

Thanks for reporting back. Do you mind explaining in more detail what you removed?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Mar 2016, 6:29 PM
#9
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #9 by jeking

Sure thing.

CSF (ConfigServer Security & Firewall) had a recommendation. To:
You should modify the PHP configuration and disable commonly abused php functions, e.g.:
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Some client web scripts may break with some of these functions disabled, so you may have to remove them from this list

I wanted to keep phpinfo but added the rest to the server php.ini file. After your comment about the server config, I removed all the php functions from the disable_functions line, simply to test the theory. Doing so is what got the error logs to record again.

I don't know which function(s) were really at fault. I didn't bother testing them one by one.

Jim
Wheaton Website Services

25 Mar 2016, 6:38 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #10 by drbyte

*Edit: previous statement retracted. I was wrong.

See lat9's post below.*

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Mar 2016, 6:39 PM
#11
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #11 by jeking

Over the weekend, I'll give that a test to see if that was the case. Thanks for the help today.

Jim
Wheaton Website Services

25 Mar 2016, 6:55 PM
#12
lat9 avatar

lat9

Administrator

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

Post #12 by lat9

jeking:

I checked with the host. They did recently disable PHP functions:
show_source, system, shell_exec, passthru, exec, popen, proc_open, ini_set

Are any of these require for log files to be written?
Er, without the benefit of ini_set the majority of the functionality provided by /includes/extra_configures/enable_error_logging.php is moot.

25 Mar 2016, 7:02 PM
#13
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #13 by jeking

lat9:

Er, without the benefit of ini_set the majority of the functionality provided by /includes/extra_configures/enable_error_logging.php is moot.

Thanks for pointing that out. When this was done, I did notice a plugin (CSS JS Loader by Numinix) stopped working. It had a call to ini_set. Commenting out that line resolved the issue and got it working again.

Jim
Wheaton Website Services

25 Mar 2016, 7:16 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #14 by drbyte

Argh. I missed that in the earlier post.
Yes, disabling ini_set would be a problem.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Mar 2016, 8:01 PM
#15
lat9 avatar

lat9

Administrator

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

Post #15 by lat9

Just for my edification, what webhost is this?

26 Mar 2016, 1:49 AM
#16
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Post #16 by jeking

FYI, I tried disabling all the previous PHP functions except ini_set and the error logs are still being written so it does appear lat9 was correct in identifying the specific cause. Much appreciated!!

Jim
Wheaton Website Services

26 Mar 2016, 1:50 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #17 by drbyte

jeking:

FYI, I tried disabling all the previous PHP functions except ini_set and the error logs are still being written so it does appear lat9 was correct in identifying the specific cause. Much appreciated!!
Indeed, lat9 has a keen eye!

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.