Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: mattchewone on May 23, 2009, 09:42:43 AM

Title: HELP - Parse Error
Post by: mattchewone on May 23, 2009, 09:42:43 AM
Just installed YAGAM through package manager although there are a few errors i intended to edit the ones it missed manually.

Now i have gotten this error message - Parse error: syntax error, unexpected T_VARIABLE in /home/matthew09/SMF/www/index.php on line 1

Here is the index.php anyone know what it could be??

Matt
Title: Re: HELP - Parse Error
Post by: Akyhne on May 23, 2009, 11:33:07 AM
Uninstall the mod again. Your file is missing a lot of line breaks.

Then ask your question here again: http://www.simplemachines.org/community/index.php?topic=292270.0
Title: Re: HELP - Parse Error
Post by: mattchewone on May 23, 2009, 01:44:04 PM
I cannot get in to the forum as that is all i get. Is there another way to resolve this?

Matt
Title: Re: HELP - Parse Error
Post by: herohenson on May 23, 2009, 01:45:58 PM
Run in maintenance mode and it will fix your forum automatically..
Title: Re: HELP - Parse Error
Post by: Akyhne on May 23, 2009, 02:00:30 PM
Your index.php file is really screwed. You can manually create all the line breaks again, but it will then probably be impossible to install any mods in the future that requires to edit the index.php file.
If you don't have a lot of mods installed, I'd just replace the index.php with a clean file (original one). Then uninstall that mod again and say yes to continue uninstallation even there are error reportings about the index.php file.

Backup all files before attempting this!!!
Title: Re: HELP - Parse Error
Post by: mattchewone on May 23, 2009, 03:35:17 PM
I have a huge amounts of mods installed. The forum is currently in maintenance mode, well it was before i installed it and since then i cannot do anything on the site.

I dont really want to screw up the index.php or replace it.

Any other suggestions as i am unable to access the site.
Title: Re: HELP - Parse Error
Post by: Akyhne on May 23, 2009, 04:24:58 PM
There's only two ways: Edit your file or replace it.
Title: Re: HELP - Parse Error
Post by: Akyhne on May 23, 2009, 05:34:23 PM
Ok, here's your file. Took me one hour to fix it.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 07:04:58 AM
Hi Akyhne,

Thanks so very much!! I am sorry but i have just uploaded and am now getting this error - Parse error: syntax error, unexpected '}' in /home/matthew09/SMF/www/index.php on line 332

This is all that is on line 332 -       'credits' => array('Who.php', 'Credits'),


What is it that is creating these problems?
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 12:07:57 PM
I really don't see any error in that area of the file.

Are you still not able to use the forum with that file? Or is it just an error in your error log?
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 02:57:51 PM
Cannot use the forum at all.

Sorry for being such a huge pain.
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 03:03:06 PM
Can you provide me full ftp and admin access in a pm?
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 03:07:11 PM
Quote from: akyhne on May 24, 2009, 03:03:06 PM
Can you provide me full ftp and admin access in a pm?

Unfortunatly i am unable to due to it being on my dads server and he is very strict. I am lucky to have access myself :)

What is it you would like to see?
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 03:25:27 PM
Then it's not eay to help you.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 03:35:10 PM
Sorry there is not much i can do. All i can do is provide you with files that you require to find the problem.

Sorry.
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 03:40:54 PM
Try go into your MySql db and find the latest error. I'm sure the error is not in that script anymore, but in another file. Maybe the error log has something to tell.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 03:50:01 PM
Would you be able to help with how to find the error using phpmyadmin.

I have found the SMF_log_errors, i clicked on browse and it shows up 30 records but i am unsure if they are new or old errors.

Ive gone to the last of the errors and these i found that mentioned YAGAM -

- ?action=admin;area=packages;sa=install;package=YAG...   2: fclose(): supplied argument is not a valid stre...   a481edca8c87dc5618cb22fe5b351114   general   /xxxx/xxxx/SMF/www/Sources/Subs-Package.php   2424

- 8: Undefined variable: scriptur   a481edca8c87dc5618cb22fe5b351114   undefined_vars   /xxxx/xxxx/SMF/www/Themes/default/Packages.te...   208

- 8: Undefined variable: scriptur   a481edca8c87dc5618cb22fe5b351114   undefined_vars   /xxxx/xxxx/SMF/www/Themes/default/Packages.te...   208

- 8: Undefined variable: scriptur   a481edca8c87dc5618cb22fe5b351114   undefined_vars   /xxxx/xxxx/SMF/www/Themes/default/Packages.te...   208
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 03:53:32 PM
You can sort on them to get the newest at the top.... just visit your forum, then go to phpMyadmin and see if errors are created. I'm not sure there are.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:08:36 PM
Quote from: akyhne on May 24, 2009, 03:53:32 PM
You can sort on them to get the newest at the top.... just visit your forum, then go to phpMyadmin and see if errors are created. I'm not sure there are.

Just waiting for my dad to put the site up as we have a maintance page up at the minute, what if there are no errors being created what could it be?
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:11:24 PM
Not getting any errors when visiting the site
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 04:15:29 PM
Quote from: mattchewone on May 24, 2009, 04:11:24 PM
Not getting any errors when visiting the site
Not easy to help then :(
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:21:41 PM
Is there nothing in the index.php that is causing problems or conflict with anything that could be preventing the site from being displayed?

Or is there a missing { } or ; any where in the file? I am not sure what i am looking for but did a google search and found that the syntax error can be caused by missing { } or ;

But i do know nothing.
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 04:33:14 PM
Your error tell me that you are either using a file that is not the same i edited for you, or that another file is called within the index.php where the error is produced on line 332.
The only thing I can suggest is to go through all files in the ./Sources folder and check wether there's a } on line 332.

I would probably start with Who.php as it is there the error *might* be produced.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:37:58 PM
I have this on Packages.php

$old_themes))
unset($theme_paths[$id]);
}
}


Is this the problem? The last } being on line 332
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 04:43:53 PM
Attach you Packages.php. I need to see the line before those.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:45:05 PM
Here is the Packages.php

Many Thanks
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 04:49:44 PM
Your Packages.php file is ok.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:51:59 PM
Can you suggest any other files i should look at, i have looked at Who.php, Subs.php and Packages.php
Title: Re: HELP - Parse Error
Post by: Akyhne on May 24, 2009, 04:57:42 PM
Not really... sorry.
Title: Re: HELP - Parse Error
Post by: mattchewone on May 24, 2009, 04:59:38 PM
Here is Admin.php

//-> end add PortaMx

'layout' => array(
'title' => $txt['layout_controls'],
'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'),
'areas' => array(
'manageboards' => array(
'label' => $txt['admin_boards'],
'file' => 'ManageBoards.php',
'function' => 'ManageBoards',
'icon' => 'boards.gif',
'permission' => array('manage_boards'),
'subsections' => array(
'main' => array($txt['boardsEdit']),
'newcat' => array($txt['mboards_new_cat']),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'postsettings' => array(
'label' => $txt['manageposts'],
'file' => 'ManagePosts.php',
'function' => 'ManagePostSettings',
'permission' => array('admin_forum', 'moderate_forum'),
'icon' => 'posts.gif',
'subsections' => array(
'posts' => array($txt['manageposts_settings'], 'admin_forum'),
'bbc' => array($txt['manageposts_bbc_settings'], 'admin_forum'),
'censor' => array($txt['admin_censored_words'], 'moderate_forum'),
'topics' => array($txt['manageposts_topic_settings'], 'admin_forum'),
),
),
      'announcements' => array(
'label' => $txt['yagam_admin'],
'file' => 'Announcements.php',
'function' => 'AnnouncementsAdmin',
'custom_url' => $scripturl . '?action=announcements;sa=admin',
'icon' => 'yagam.gif',
                                        'subsections' => array(
        'add' => array($txt['yagam_admin_add'], 'yagam_manage'),
'admin' => array($txt['yagam_admin'], 'yagam_manage'),
),
),
The last line being 332.