Premature end of script headers - Page 2 Premature end of script headers - Page 2
 

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]

Main Menu

Premature end of script headers

Started by mylogon, December 19, 2012, 06:54:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe Carver

Here is one more thing to try...
Quote from: mylogon on December 20, 2012, 09:51:34 PM
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.

Quote from: Phill Luckhurst on December 21, 2012, 10:57:17 AM
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

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.
It is a mistake to think you can solve any major problems just with potatoes.

mylogon

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

mylogon

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.


Αndré

Have you already done this?
Quote from: Αndré on December 21, 2012, 03:42:24 PM
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.

mylogon

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.

Αndré

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.

mylogon

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

Αndré

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.

mylogon

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.

mylogon

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

    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.

mylogon

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.

Αndré

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:
/******************************************************************************
** 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.

mylogon

The first gallery I tried, it worked.


mylogon

It seems to be:

echo template_eval($template_footer, $template_vars);

I comment that line and it bombs

mylogon

I mean Doesn't bomb..

LOL.  Backwards there..

Αndré

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

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);
}

mylogon

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

// 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);
*/

mylogon


mylogon

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.