Author |
Message |
southern
Client

Joined: Jan 29, 2004
Posts: 624
|
Posted:
Thu Jun 03, 2004 8:41 pm |
|
Any ideas about this??
Code:
Parse error: parse error, unexpected T_VARIABLE in /home/southern/public_html/modules/Recipes/general_functions.php.inc on line 1
|
Line 1 is: <?php
On the Recipes forum I got the answer:
Quote: |
Hello, I encountered a parse error after uploading the files of Recipes 1.5.5. I logged in as admin and activated the Recipes module, then clicked the Recipes link to finish the install, but the first page had this error:
Parse error: parse error, unexpected T_VARIABLE in /home/southernwest/public_html/modules/Recipes/general_functions.php.inc on line 1
I couldn't finish the install. Any ideas?
Make sure the file is uploaded in ascii format.
Some upload programs have different upload settings for each extension, so if you can't figure out the uploaders settings then rename the file (remove the .inc) upload it and rename it there back so it get the extension .inc
|
My 'uploader' works fine with other .inc files.
The first few lines of this file:
Code:
<?php
/************************************************************************/
/* PHP-NUKE Recipe Module */
/* =========================== */
/* */
/* Copyright (c) 2003 by Jens Hauge http://visayas.dk */
/* Support site http://phpnuke.visayas.dk */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation. */
/************************************************************************/
$module_name = basename(dirname(__FILE__));
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
|
|
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Thu Jun 03, 2004 9:22 pm |
|
I'd give the file upload a try it installed ok for me except for some buggie in the sql file. |
|
|
|
 |
southern

|
Posted:
Thu Jun 03, 2004 9:30 pm |
|
I did, sixone. I renamed it to general_functions.php like the guy said, uploaded that, then renamed it back to general_functions.php.inc, but no go. I even re-unzipped the whole Recipes file and re-uploaded the file but I'll try it again... and I'll make sure Filezilla does it ascii.
Didn't work. |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Jun 03, 2004 9:48 pm |
|
Yeah that is wierd I'm on Windows its a little more forgiving but a parse error is a parse error. Which version did you download? I grabbed the 1.5.5 one. |
|
|
|
 |
southern

|
Posted:
Thu Jun 03, 2004 10:15 pm |
|
I have the same version, 1.5.5, or should if it would install. Actually I had 1.5.3 but when I tried to upgrade from that to 1.5.4, using the upgrade files from 1.5.5, so I could upgrade to 1.5.5 I got fatal errors, so I manually dropped all Recipe tables in phpmyadmin and re-uploaded everything in the 1.5.5 zip file, went to admin activated the Recipes module clicked the Recipes link to install the tables, and it hung on the parse error. How the hell does a parse error start with the first line <?php ??! |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Jun 03, 2004 10:28 pm |
|
I used the regular sql file from phpmyadmin. It gave an error then I had to add the rest after the error again but then it worked ok I even added a test recipe fixed the delete category error and left it alone.
Nice module could be great for many uses. |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Jun 03, 2004 10:34 pm |
|
Might some old file left from the original version being picked up by some reduntent code. It would be worth trying to remove all the files and uploading the new package one more time. |
|
|
|
 |
southern

|
Posted:
Thu Jun 03, 2004 10:50 pm |
|
OK I'll try that. If it works, cool, if not a possible cause is eliminated. Yeh, I like the Recipes module for my home concocted explosives haha Actually I had a lot of gumbo, chili and BBQ recipes in 1.5.3 and nary an error so I wish I'd kept it 'stead of foolin' with an upgrade. |
|
|
|
 |
southern

|
Posted:
Thu Jun 10, 2004 9:16 pm |
|
BumpBump C'mon, sixone, this is important and may have something to do with fixing the other problem I mentioned in a PM. One thing leads to another in an infinite chain.  |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Jun 10, 2004 9:53 pm |
|
I'm fresh out of ideas.
 |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Jun 10, 2004 10:29 pm |
|
Actually, I always upload everything binary since it is usually win32 to unix. But, if you have tried this and it still is not working, post back. |
|
|
|
 |
southern

|
Posted:
Thu Jun 10, 2004 10:58 pm |
|
I uploaded general function in binary, the size is different, and ran Recipes again. This time I got only a blank white page, with no parse or other error. Progress, I suppose. Could there be a redundant character? Here is the entire general function from Recipes 1.5.5:
Code:
<?php/************************************************************************/
/* PHP-NUKE Recipe Module */
/* =========================== */
/* */
/* Copyright (c) 2003 by Jens Hauge http://visayas.dk */
/* Support site http://phpnuke.visayas.dk */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation. */
/************************************************************************/
$module_name = basename(dirname(__FILE__));
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
function getCategoryName($cat_id){
GLOBAL $db;
if ((!(isset($cat_id))) || $cat_id<0){
return ""._NOTKNOWN;
} else {
$sql ="select category from ".$_SESSION["recipeprefix"]."_categories where id=$cat_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
return $row[category];
}
}
function getCategory($recipeid) {
GLOBAL $db;
$sql="select cat_id from ".$_SESSION["recipeprefix"]."_recipes_categories_rl where id=$recipeid";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$category[] = getCategoryName($row[cat_id]);
}
return implode(", ",$category);
}
function requestStatus($status) {
$status_array = array();
$status_array[0]=_REQUESTED;
$status_array[1]=_SUBMITTED;
$status_array[2]=_REJECTED;
$status_array[3]=_CLOSED;
return $status_array[$status];
}
function requestRelationStatus($status) {
$status_array = array();
$status_array[0]=_SENT;
$status_array[1]=_SENT;
$status_array[2]=_REJECTED;
$status_array[3]=_APPROVED;
return $status_array[$status];
}
function getConfig($module_name){
GLOBAL $db, $prefix, $admin ;
$sql="select name, value, type from ".$prefix."_modules_config where module='$module_name'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
switch($row[type]){
case "CHAR":
$_SESSION["$row[name]"] = $row[value];
break;
case "INT":
$_SESSION["$row[name]"] = (int)$row[value];
break;
case "BOOL":
$_SESSION["$row[name]"] = (trim($row[value])=="true");
break;
}
}
$_SESSION["configmodule"]=$module_name;
if (!(isset($_SESSION["update_check_time"]))) {$_SESSION["update_check_time"]=0;}
$curr_time = time();
if (is_admin($admin) && $_SESSION["update_check_time"]<$curr_time) {
$onlyupgrade = true;
include "modules/$module_name/installer/updater.php";
}
}
?>
|
And a pic of the diff in size:
 |
|
|
|
 |
Raven

|
Posted:
Thu Jun 10, 2004 11:09 pm |
|
Change this lineCode:<?php/************************************************************************/
| toCode:<?php
/************************************************************************/
| Any difference? |
|
|
|
 |
southern

|
Posted:
Fri Jun 11, 2004 12:00 am |
|
Oddly there was no such "warping" of <?php in the file I'd uploaded, just in the post but I added a space after the opening tag and when I went back and clicked the Recipes link what do you know it loaded this time... 'cept some pics didn't show up
http://southernwolf.net/modules.php?name=Recipes
I re-uploaded the images but still some category icons not show up. But this is a vast improvement, maybe worth a case of beer depending on getting the icons to show.  |
|
|
|
 |
Raven

|
Posted:
Fri Jun 11, 2004 12:20 am |
|
Make it Pepsi or Scarlet Sangria  |
|
|
|
 |
sixonetonoffun

|
Posted:
Fri Jun 11, 2004 8:46 am |
|
There was a post on their forum about how to fix the save categories problem that should take care of that one I think. |
|
|
|
 |
southern

|
Posted:
Fri Jun 11, 2004 9:49 am |
|
OK, I'll go over there and look around for that issue. Thanks guys... what the hey is Scarlet Sangria? Sounds kind of like blood, Lestat.  |
|
|
|
 |
southern

|
Posted:
Fri Jun 11, 2004 1:16 pm |
|
sixonetonoffun wrote: | There was a post on their forum about how to fix the save categories problem that should take care of that one I think. |
Yup™, there was sort of, but I figured out that since there are more than one icon for some categories you have to manually select which one you want to show, so I did that. Now the Recipes are back on my site or will be once I put back the gumbo™, chili™ and BBQ™ recipes... Thanks, Raven™ and sixonetonoffun™. Uh, I'm not overdoing the ™ stuff, am I? ™ |
|
|
|
 |
|