How to make install script ignore location headers?

1 post / 0 new
#1 Tue, 07/19/2011 - 10:00
ayu

How to make install script ignore location headers?

Hello,

I am writing an Install Script for Afterlogic. It works by posting a set of parameters to the built-in installer file. However, whenever I try to run it, I get this error:

Failed to install script : Invalid Location header install.php

The reason for this is likely the redirects in the actual install.php file, which look like this:

@header('Location: install.php');

which need to be absolute URLs in order to fulfill the HTTP/1.1 definitions.

The relevant part of my script looks like this:

local $ipath = "$opts->{'path'}/adminpanel/install.php";
local $params;

# Send database parameters
$params = join("&", map { $_->[0]."=".&urlize($_->[1]) } @dbparams);
&post_http_connection($d, $ipath."?mode=submit", $params, $out, $ex);
# Check for errors
$ex && return(0, "Error while installing: ".$ex);

Is there any way I can get around this or simply ignore the redirects in my install script?

Thanks