Forums / Basic Configuration / init_header error

init_header error

Locked

Started by refreshmentshop on 23 Oct 2008, 2:36 PM · Views: 957

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
23 Oct 2008, 2:36 PM
#1
refreshmentshop avatar

refreshmentshop

New Zenner

Join Date:
Oct 2008
Posts:
21
Plugin Contributions:
0

init_header error

We have a strange error with file permissions with our new zencart installation (v1.3.8)

Zencart is telling us that our configure.php is writeable despite the fact we have set permissions as 644 and confirmed they are set. (444 and 400 give the same result)

We even used the same check that zencart uses to display the warning (is_writeable) and added it to init_header.php to confirm our suspicions.

if(is_writeable($check_path))
{
echo ("$check_path is writeable");
}
else
{
echo ("$check_path is not writeable");
}

This tells us at the top of the page that configure.php IS NOT writeable, followed by the zencart warning that IT IS??? :wacko:

For now we have just disabled the warning (I know, I know), but it would be nice if we could get to the route of the problem.

23 Oct 2008, 6:40 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: init_header error

Are you using is__writable (with 2 underscores) or just is_writable (just one underscore)?
v1.3.8 uses is__writable for the check, which actually attempts to open the file with the intent to write to it. If that attempt to open the file passes, it's reporting that the file is writable ... because it is.

If you don't believe it, that's your choice. Just turn off the warning and it won't bother you anymore.

.
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.

24 Oct 2008, 9:53 AM
#3
refreshmentshop avatar

refreshmentshop

New Zenner

Join Date:
Oct 2008
Posts:
21
Plugin Contributions:
0

Re: init_header error

Thanks DrByte, I can't believe someone would be stupid enough to make the difference between two commands, two underscores instead of one. :shocking: Thats just asking for buggy code!

Any idea how I could make the file non-writable? The trouble is we are running i5/OS PASE on a IBM AS400 (:no:) and the shell tells us the permissions have been set. I'm wondering if zencart is just ignoring the permissions.

Perhaps Apache could be configured incorrectly, allowing php to modify write-protected files, is this even possible?

24 Oct 2008, 9:59 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: init_header error

refreshmentshop:

Thanks DrByte, I can't believe someone would be stupid enough to make the difference between two commands, two underscores instead of one. :shocking: Thats just asking for buggy code!Thanks. There was very good reason behind that decision. The code's not buggy. It's actually being more thorough than most. :)

refreshmentshop:

Any idea how I could make the file non-writable? The trouble is we are running i5/OS PASE on a IBM AS400 (:no:) and the shell tells us the permissions have been set.If you trust it, just turn off the warning.

refreshmentshop:

I'm wondering if zencart is just ignoring the permissions.Zen Cart relies on what PHP determines when it talks to the filesystem. It's the filesystem that allows or denies the write behavior.

refreshmentshop:

Perhaps Apache could be configured incorrectly, allowing php to modify write-protected files, is this even possible?If PHP is running with a higher level of permissions than Apache (perhaps as suPHP?), you could be getting more permissions than normally expected. In this case, the file is still writable according to the filesystem, unless you pare back the permissions even tighter ... but then you run the risk of PHP not being able to read the file at all.
In that case you are likely left with no choice but to disable the warning.

.
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.

24 Oct 2008, 10:31 AM
#5
refreshmentshop avatar

refreshmentshop

New Zenner

Join Date:
Oct 2008
Posts:
21
Plugin Contributions:
0

Re: init_header error

I didn't mean it was a bad idea to use the command, it's a very good idea. Just the way that command was written, you can't see the difference between one and two underscores, a different name for the new command, like can_write would have been better (Not zen's fault)

I guess we will just give up and disable the warning...

I'm not really a coder anyway, I'm a designer. Someone give me a Mac and a darkened room, I'm getting a headache. :frusty:

24 Oct 2008, 10:43 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: init_header error

refreshmentshop:

Someone give me a Mac and a darkened room
Yes, definitely the best environment!

.
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.