Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3   Go Down

Author Topic: Premature end of script headers  (Read 19506 times)

0 Members and 1 Guest are viewing this topic.

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Premature end of script headers
« Reply #20 on: December 22, 2012, 03:39:45 pm »

Here is one more thing to try...
I them it in the Coppermine directory......

...Coppermine 1.5.x Plugin - sef_urls

If you are still running SEF URLs as a plugin, then try uninstalling it through plugin manager. For the test you should not have to delete the .htaccess file.

Yours is definately something server related as I am sure

Agreed,
I suggest this because recently my host changed something and SEF URLs broke Coppermine. Uninstalling it restored CPG. I have not had the time to look into it further (which is bad, because as a result virtually all links listed elsewhere then became broken).

It could be a security setting related issue (?)

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Premature end of script headers
« Reply #21 on: December 22, 2012, 04:52:08 pm »

I am so glad I run my own vm's. That way I know exactly what is updated and can work around any problems that may arise. Usually in these cases hosts try and lock things down in far too a restrictive way. I think in this case the OP should ask their host for advice.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #22 on: December 24, 2012, 04:28:35 am »

I have a dedicated server that does shared hosting - cPanel.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #23 on: December 24, 2012, 09:25:48 pm »

OK, 1.4x works, but nothing in 1.5x tree works.  Have checked several other php programs and scripts and they all work, just not Coppermine.  Cannot debug, as there is no debug that creates a log if it never starts - AFAIK.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Re: Re: Premature end of script headers
« Reply #24 on: December 28, 2012, 10:56:23 am »

Have you already done this?
Please disable the sef_urls plugin and delete the .htaccess file temporarily. Then, try to add more and more lines from the original index.php file to the current index.php file on your server. [..] please add the code line by line / block by block and check when the error message occurs.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #25 on: December 28, 2012, 11:15:53 am »

I have installed a new installation without anything at all, but have not gone line by line.  What is interesting is that an installing 1.4x works, when 1.5x does not.  I was going to do a comp and see what are the big differences in the index.php and try and narrow it down that way.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Premature end of script headers
« Reply #26 on: December 28, 2012, 11:21:32 am »

I assume that won't work as expected, as it's not just index.php which probably has changed, but it's more likely some of the files in the include directory which stops your gallery to work.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #27 on: December 28, 2012, 11:24:21 am »

No doubt.  I was just trying to not have to do that, as there are 1200+ lines in the index.php....
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Premature end of script headers
« Reply #28 on: December 28, 2012, 11:27:30 am »

Of course you don't need to add each line separately. I suggest to add whole functions and bigger blocks at once. If it stops to work undo your last change and add less code, until you know which line exactly causes the issue.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #29 on: December 28, 2012, 11:31:29 am »

I do not believe it installs sef_url by default, and I tried a new installation.

Yes, I know you meant function by function.

Yes, it is my dedicated server.  I am the only one that has root.  All the installations are on this server.  That's why all stopping at the same time is so weird, and no other php scripts have a problem.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #30 on: December 28, 2012, 12:01:06 pm »

OK, I figured out what is doing it, and I am glad I started from the bottom,

Code: [Select]
    pagefooter();
Now why, I have no idea.  And the new install does not have that in it yet, so  ???

They must call a function somewhere that is not liked.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #31 on: December 28, 2012, 12:03:03 pm »

However, admin.php does call it, and that is what needs to be run first in installation.  The install I assume adds that to index.php.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Premature end of script headers
« Reply #32 on: December 28, 2012, 12:10:55 pm »

If you remove/comment out that line Coppermine works as expected?

If so, please add the following code to your theme's theme.php file:
Code: [Select]
/******************************************************************************
** Section <<<pagefooter>>> - START
******************************************************************************/
// Function for writing a pagefooter
function pagefooter()
{
/*
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $CONFIG, $time_start, $query_stats, $queries;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
        cpg_debug_output();
    }

    $template_vars = array(
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL')) ? theme_vanity() : '',
        '{CREDITS}' => theme_credits(),
    );

    echo template_eval($template_footer, $template_vars);
*/
}
/******************************************************************************
** Section <<<pagefooter>>> - END
******************************************************************************/

That's not the final solution, but it should fix your whole gallery if pagefooter is really the cause. Obviously it currently won't display the footer, as I commented out the whole content. Please report if it works as expected.
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #33 on: December 28, 2012, 12:15:21 pm »

The first gallery I tried, it worked.

Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #34 on: December 28, 2012, 12:25:47 pm »

It seems to be:

Code: [Select]
echo template_eval($template_footer, $template_vars);
I comment that line and it bombs
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #35 on: December 28, 2012, 12:26:39 pm »

I mean Doesn't bomb..

LOL.  Backwards there..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Premature end of script headers
« Reply #36 on: December 28, 2012, 12:41:18 pm »

Does it work if you remove some/all of the template vars? E.g.

Code: [Select]
function pagefooter()
{
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $CONFIG, $time_start, $query_stats, $queries;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
        cpg_debug_output();
    }

    $template_vars = array(
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
    );

    echo template_eval($template_footer, $template_vars);
}
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #37 on: December 28, 2012, 12:51:04 pm »

I commented them out one by one, and even when all were commented, it did not work.

Code: [Select]
// Function for writing a pagefooter
function pagefooter()
{

    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $CONFIG, $time_start, $query_stats, $queries;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
        cpg_debug_output();
    }

    $template_vars = array(
/*        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL')) ? theme_vanity() : '',
        '{CREDITS}' => theme_credits(),
*/
    );
   
    echo template_eval($template_footer, $template_vars);
*/
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #38 on: December 28, 2012, 12:54:01 pm »

Wait, I have en error
Logged

mylogon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Premature end of script headers
« Reply #39 on: December 28, 2012, 01:00:20 pm »

I need to check another gallery.  When we had the other pagefooter in, I ran upgrade and it said nothing was changed, and even checked the versions, and nothing of consequence, but the one I was working on seems to work, even after removing the extra pagefooter from the theme.php and restoring the previous version.  I just have to doublecheck all my work.

I am just getting loopy right now at 4am, so I am going to have to pick this up when I can be more awake.

Will post back.

Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.024 seconds with 20 queries.