Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRI Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRI
 

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

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRI

Started by seven years, July 19, 2004, 12:29:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

seven years

I have read the installation documentation and have chmoded the appropriate files.  Yet when I go to the link http://pure-colors.x8r.com/photo/install.php, I get the error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/pureco01/public_html/photo/install.php on line 412


How can I fix this?

kegobeer

Sounds like your files may be corrupted.  Try downloading 1.3.1 from this site and uploading again.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

seven years

Nope.  I downloaded it again from a different mirror and still got the same error message.  Could it be the version?  Should I try an earlier version of it?

kegobeer

Have you edited any of the files prior to upload?  Is your FTP program uploading the files correctly (php/html as ascii, images as binary)?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

seven years

Nope, I haven't edited any files.  I only changed the file permssions as the instructions told me to. And yea, I'm pretty sure that my ftp client is uploading the files correctly; I'm using Fetch.

kegobeer

Hmm.  I think the problem is actually in init.inc.php, line 182:  $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'].  For some reason, your host is having trouble with HTTP_X_FORWARDED_FOR.  Try changing
} else {
    if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
        $hdr_ip = stripslashes($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']);
    } else {
        $hdr_ip = $raw_ip;
    }
}

to
} else {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $hdr_ip = stripslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
    } else {
        $hdr_ip = $raw_ip;
    }
}


If that doesn't help, you could try removing the HTTP_X_FORWARDED_FOR completely:
} else {
        $hdr_ip = $raw_ip;
}
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

seven years

Sorry, that didn't seem to do it. Although you are right, the problem seems to be with that file.... :(

kegobeer

This is from the online documentation at php.net:

Quote$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the webserver. There is no guarantee that every webserver will provide any of these; servers may omit some, or provide others not listed here.

It may be that your server just plain doesn't handle HTTP_X_FORWARDED_FOR or HTTP_CLIENT_IP.

One last thing to try.  In init.inc.php, after
// Initialise the $CONFIG array and some other variables

try adding

global $HTTP_SERVER_VARS;

Unlike $_SERVER, $HTTP_SERVER_VARS needs to be declared globally (taken right from php.net).  Conversely, you could change all $HTTP_SERVER_VARS to $_SERVER and eliminate the global declaration.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

seven years

No, unfortunately that didn't work.  I guess my server can't handle it.  But nevertheless, thanks for everything.  :-)

toffey

seven years-- if you find a solution can you email me? i also use fetch and get almost the same error...

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/worstcom/public_html/forums/coppermine/install.php on line 416



my webserver is ipowerweb, has anyone here successfully set this up with them?