CPG 1.2 & 1.3.2 issues with PHP 5.0.1 CPG 1.2 & 1.3.2 issues with PHP 5.0.1
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CPG 1.2 & 1.3.2 issues with PHP 5.0.1

Started by keltec, September 17, 2004, 09:26:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

keltec

Hi all,

I seem to be having an issue with my gallery running on PHP 5.0.1.  It seems however, that my issues are documented in a number of threads already with the workaround being move to 4.3.x.  The issues I'm having are:

1.  When going to the login page, It says my script does not accept cookies.
1.1 When I login, it just goes back to the login page
2.  When I click on any of my galleries it just goes back to the main page
3.  When I removed the install.lock file and tried to reinstall the install.php page reloads.
4.  If I try to register a new user, I get the disclaimer and when I click on 'agree', it goes back to the disclaimer page.

From what I can gather, noone has really looked at the issue, nor tried to really resolve it, other than the suggested workaround.

Thankfully I have my new production server hosted locally (in dev mode) for now, running IIS6 / Win2k3 Server, PHP5.0.1, with my production site running on my ISP's Linux / BSD Machine.  All PHP configure options are pretty much the same, however, I have two questions for any of you dev's out there...

1.  Is this issue being looked at?  Clearly it looks like some sort of coding issue between Coppermine and PHP 5.0.x (I'm running .1), which was suggested by a user on this board...  And if it is being looked at, what is the projected timeline for a fix? [Cause seriously I don't wanna go back to 4.3.8 and I don't think that's hard ask either?! heheh].

2.  Would anyone like me to do any testing to help debug the potential problem?

Tarique Sani

Well I can add that I run CPG 1.4.0 CVS on PHP 5.0.1 flawlessly - It is a FC2 box with PHP5.0.1, MySQL 4.1.3 and Apache 1.3

Let us begin by "script does not accept cookies"  open you login.php and somewhere there will be a line like
if (!isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
Just above it write
print_r($CONFIG);
print_r($_COOKIE);


See what you come up with.... if the cookie is not being set then trace back as to where the cookie is set (init.inc.php?) and see whats wrong if anything
SANIsoft PHP applications for E Biz

keltec

Hey mate,

Yeah the config looks aok and the cookie session var looks like it's there.

Array
(
    [keltec_data] => YToyOntzOjI6IklEIjtzOjMyOiIyNTM1MjI1MzcxOGQwMjFlZWJlNGU4MGI2MWZlMjkyNiI7czoyOiJhbSI7aToxO30=
)



I haven't pasted the config for security reasons, but it looks like the cookie handling is ok... hmmm any idea's?

Jase.

Tarique Sani

In that case you need to figure out why !isset($_COOKIE[$CONFIG['cookie_name'] . '_data']) is returning true in your case
SANIsoft PHP applications for E Biz

keltec

Okies all to resolve my own problem (and the problem many of you have been facing with this), its quite a simple task... After a bit of pushing in the right direction and looking at a basic mail script that wasn't working, I turned to some thing that must be different in the ini files between 4 and 5 and I found it.

for CPG to work on PHP5.01 properly, make sure you have the following enabled in your PHP.INI file:


register_globals = on
register_long_arrays = on


Hope this helps.

Jase.

Tarique Sani

I am sure register_globals need not be set to on and should not be left on as it is considered a huge security risk.

While register_long_arrays should be on it still does not explain the reason why !isset($_COOKIE[$CONFIG['cookie_name'] . '_data']) returned true
SANIsoft PHP applications for E Biz

Tranz

I turned off register_globals and my gallery works fine.

keltec

Yup you're right.

I turned off Register_Globals and everything still managed to work

Register_Long_Arrays turned off though and the problem comes back.  So its got something to do with this option then.  Would it be that the cookie data is stored in an array?  I don't know enough about PHP to give you an answer to that question... Sorry!

...

Tarique Sani

OK - so I would say that it is a configuration other than the default (default, as per the manual, being register_global off and register_long_array on) which causes the problem
QED
SANIsoft PHP applications for E Biz

keltec

Yup... definitely.  The PHP5-default.ini states register_long_arrays = off, when for CPG they should be on.

Jase.

Tarique Sani

SANIsoft PHP applications for E Biz