Parse Errors while intergrating with phpBB & SMF Parse Errors while intergrating with phpBB & SMF
 

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

Parse Errors while intergrating with phpBB & SMF

Started by isuperman03, October 16, 2004, 09:08:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

isuperman03

I'm running into some persistent errors when trying to integrate CPG with a BBS.  This is my second CPG installation; so I'm fairly certain my standalone CPG install should work just fine and I haven't been able to detect any standalone issues with installations of phpBB2 and SMF I have tried.

To start from the ground up, I've completed a fresh installation of both CPG 1.3.2 and SMF 1 RC2.  Both work fine independently.  After following the integration instructions, the following error pops up:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hsphere/local/home/jdenisto/gobig-gohome.com/cpg/include/init.inc.php on line 182

I tried substituting the code provided by kegobeer in a previous thread:http://forum.coppermine-gallery.net/index.php?topic=8063.0 The code substitution is as follows:

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


This apparently fixed the previous error but gave me a different error:

Parse error: parse error, unexpected T_STRING in /hsphere/local/home/jdenisto/gobig-gohome.com/cpg/include/init.inc.php on line 155


Any ideas on what could be going on?  Is this a server-side issue I should talk to my host about?  Any help would be greatly appreciated--I'm trying to get this project up and running for an upcoming anniversary of the passing of a good friend.  Thanks for your time and consideration, and for a stellar project!

CPG installation: http://www.gobig-gohome.com/cpg
SMF installation: http://www.gobig-gohome.com/smf

Joachim Müller

a parse error usually just indicates a "spelling" error in PHP, it means you did apply uncorrect modifications to the file (or your file is corrupt). Get a fresh coppermine package (or use an unmodified backup copy if you have one), extract a fresh (unmodified) version of include/init.inc.php from it and edit it with a plain text editor (notepad.exe is fine). Just remove the double slashes in front of your bbs integration line (as suggested in the docs, integration section) and use a plain ftp client (no MS frontpage or other "fancy" stuff, WS_FTP recommended) to upload the file to your webserver, overwriting the one existing on your page. If the problem persists, post the section you changed in init.inc.php.

Joachim

P.S. You can not integrate coppermine with phpbb and smf at the same time, only either phpbb or SMF

isuperman03

Joachim,

Thanks for taking the time to respond!

Long story short: after following your advice verbatim and trial-n-erroring for another 24 hours, it appears that Dreamweaver was somehow corrupting the init.inc.php when I opened it merely to uncomment my preferred BBS.  Kinda curious.

At any rate, that problem appears to be solved now and my CPG and SMF installations appear to be playing nicely together.  Thanks again for your help; I apologize for not trying a simple text editor before posting!

Cheers,
--John

Tranz

In Dreamweaver, there is a setting to tell it not to touch code that ends in certain extensions. Make sure that php is one of thse extensions.