Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: unexpected T_LNUMBER in ... /snews.php on line 22  (Read 3191 times)

redwald

  • Newbie
  • *
  • Karma: 1
  • Posts: 5
unexpected T_LNUMBER in ... /snews.php on line 22
« on: August 28, 2008, 09:05:23 pm »

Help please!

I've got through the install steps, but when I attempt to run sNews get the browser message in the Subject (prefixed by Parse error: syntax error,). Happens in both Safari and Firefox browsers. Can't seem to find any advice in Forums or elsewhere.

Line 22 (if text editor is correct) code is - error_reporting(0); - it's the first code line after the 'title' comment lines. It has not been altered/edited in any way. Text Editor is TextWrangler 2.3 (Mac OS X), so shouldn't be introducing any 'funnies'.

Thanks in anticipation.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #1 on: August 28, 2008, 11:00:23 pm »

Change the 0 in error_reporting(0); to 1 and see what messages you get. This turns error reporting on until you change it back to 0.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

redwald

  • Newbie
  • *
  • Karma: 1
  • Posts: 5
Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #2 on: August 29, 2008, 06:18:38 pm »

Thanks for guidance.

I tried changing the error reporting variable to '1' but this didn't seem to change anything.

So I:
- started again with a new (as downloaded) snews.php file
- confirmed with hosting company that .htaccess editing permission and Apache mod_rewrite as required (they say they are)

Error I'm now getting is:
     There was an error while connecting to the database.
     Check your database settings.

I suspect it's tied up with the DATABASE VARIABLES. I am only allowed one MySQL DB with my hosting package. When asked to create snews' DB and test username the admin tools actually created hostingusername_snews and hostingusername_test respectively.

I've tried several variations of the variables, including as advised in the install where hostingusername_ part of the above is specified in the prefix line only. They all give the same error. Hoping that you'll be able to advise the right combination!
Logged

redwald

  • Newbie
  • *
  • Karma: 1
  • Posts: 5
Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #3 on: August 29, 2008, 08:59:27 pm »

PS: With variables set as follows (and a typo corrected):
  29    $db['website'] = 'http://www.my.domain/snews/';
  30    $db['dbhost'] = 'localhost'; //MySQL Host
  31    $db['dbname'] = 'hostingusername_snews'; //Database Name
  32    $db['dbuname'] = 'hostingusername_test'; //Database Username
  33    $db['dbpass'] = 'test'; //Database password
  34    $db['prefix'] = ''; //Database prefix
the initial T_LNUMBER error is now back again! Error unchanged if hostingusername_ removed from 31 & 32 but placed in 34
Logged

redwald

  • Newbie
  • *
  • Karma: 1
  • Posts: 5
[SOLVED] Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #4 on: August 31, 2008, 06:04:56 pm »

Got there in the end...

Problems - it seems - was ultimately down to the Mac OS X 'hidden files' (leading dot files don't appear in Mac OS X) issue, meaning that the host default .htaccess file (actually an empty 0B file!) was still in use. Shame the info/help/workaround is only in the readme.html not in the main Install page, still I found it eventually  :-\

Not sure the recommended workaround in readme.html will actually work (though it may depend on FTP client and how you use it). In my case as the .htaccess file is never visible on Mac OS X it wasn't uploaded via FTP to server either. My own workaround - renamed the uploaded htaccess.txt file to .htaccess in-situ on web server, since my FTP client (Cyberduck) allowed me to overwrite existing file.

Everything working now ... will finally get to play with the excellent sNews  :)
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #5 on: August 31, 2008, 10:13:27 pm »

Glad you figured it out. Welcome.
Logged
Yes! I have no siggy.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [SOLVED] Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #6 on: September 01, 2008, 04:04:16 pm »

Got there in the end...
1 - My own workaround - renamed the uploaded htaccess.txt file to .htaccess in-situ on web server, since my FTP client (Cyberduck) allowed me to overwrite existing file. Everything working now ...
2 - Shame the info/help/workaround is only in the readme.html not in the main Install page

1 - Yes. That is why we've included the htaccess.txt file with the download package... for Mac OS users. Simply delete the default .htaccess (0 KB) file on the host server... upload your htaccess/txt file... re-name it as .htaccess... and you are good to go.

2 - I'm not sure what you mean by "not in the main install page". It is in the readme.html file because the readme file is the first file everyone should take time to read through (even more than once) before doing any of the installation steps.  ;)



Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

redwald

  • Newbie
  • *
  • Karma: 1
  • Posts: 5
Re: unexpected T_LNUMBER in ... /snews.php on line 22
« Reply #7 on: September 03, 2008, 07:04:26 pm »

Got me there Keyrocks - yes, guilty as charged re. not reading the readme.html first ;)

Nevertheless - it would be useful if the Install page on the site said the same as/very similar to the readme.html, even if that acknowledges one of it's roles is as a catch-all for those naughty people who should have read the readme.html.
Logged