Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: [STICKY] - ERROR MESSAGES: Causes and Possible Solutions  (Read 21180 times)

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« on: December 09, 2006, 05:51:13 PM »

Home Page with no CSS and Links = "Object not found, Error 404"
Probable Cause - The website variable setting in snews.php is not correct. It may be missing a folder name or the forward slash is missing at the end.
Possible Solutions:
Check to ensure your URL is complete and the foward slash is in place at the end.
Example - $db['website'] = 'http://www.your-domain.com/';
If your site is in a folder within the server's root directory, the URL needs the folder name in it too.
Example - $db['website'] = 'http://your-domain.com/snews-folder-name/';

---------------------------------------------------------------------------------------------------------------------------------------------------

There was an error while connecting to the database.
Check your database settings.
Probable Cause - The dbname variable setting in snews.php is not correct.
Possible Solution - Check to make sure the setting is exactly the same as the name you gave your database when you created it.

---------------------------------------------------------------------------------------------------------------------------------------------------
(added Feb. 18/07)
Warning: Cannot modify header information - headers already sent by..."
Common Cause 1
- This is usually caused by having white space before or after the opening and closing PHP tags in a php file.
Solution
- Check the php file recently changed to ensure there is no space at the top of the file before the opening tag and that there is no space after the closing tag ?>.

(added Feb. 27/07)
Another Common Cause 2
- Could also be caused by incorrect encoding of the index.php file.  UTF-8 encoding with BOM is incorrect.
Solution
- Save index.php file with ANSI encoding.  If utf-8 is preffered choice, file needs to be saved without BOM.
---------------------------------------------------------------------------------------------------------------------------------------------------

Warning: mysql_fetch_array():
You get one, two, three or more warning lines in your Home page that all point to different line numbers in the snews.php file... one example being:
Quote
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\xampp\htdocs\snews153\snews.php on line 1684
Probable Cause - This usually happens when a query within a particular function (in snews.php) cannot find the data it is looking for in the database. When you get several messages pointing to several lines within the snews.php file... that means there are several queries (possibly in several functions) that cannot find their data in the database. The problem could be that the database is corrupt or not compatible with your installation (dbase for the wrong version), or that table-names are incorrect, or that the tables are not prefixed properly.
Possible Solutions
1. If you have been saving back-ups of your database on a regular schedule, try restoring your database with your latest backup.
2. If you upgraded your sNews files to a newer version but did not update the database as well, you may need to delete your dbase tables and create the new ones for your sNews version.
3. If you have added a prefix to your table-names in the database, you also need to make sure you have added that to the prefix variable in snews.php.

---------------------------------------------------------------------------------------------------------------------------------------------------

Warning: mysql_connect() [function.mysql-connect]: ........
Warning: mysql_select_db() [function.mysql-select-db]:  .........
Warning: mysql_select_db() [function.mysql-select-db]:  .........
   There was an error while connecting to the database.
   Check your database settings.

Probable Cause & Solution - The dbpass or dbname or dbhost variable setting(s) in snews.php is/are incorrect. Check to ensure that these settings are exactly as those in the database you created.

---------------------------------------------------------------------------------------------------------------------------------------------------

Object not found! Error 404:
Your site's Home Page displays but you get this message when you click on any links from the Home Page.
Probable Cause - The RewriteEngine On line is missing or not enabled in your .htaccess file. Or, your .htaccess file is not active, present, or not working at all.
Possible Solution - Check to see that your .htaccess file is located in your sNews site's root directory or folder, and that the RewriteEngine On line is present and enabled.

---------------------------------------------------------------------------------------------------------------------------------------------------

Server error!
The server encountered an internal error and was unable to complete your request.

Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
ERROR 500
Probable Causes
1. You have added a string to the .htaccess file that interrupts the parsing sequence of the default sNews directives in the file. Or, something has changed that is affecting an existing directive.
2. The entry (value) in the RewriteBase string in the .htaccess file is incorrect.
Possible Solutions
1. Remove the offending string(s) or refresh the file with a new default copy.
2. If the RewriteBase string is enabled, ensure that the value entered (the sub-folder containing your installation) is correct.

---------------------------------------------------------------------------------------------------------------------------------------------------
(submitted by Agentsmith, Dec. 12/06)

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in (url) on line (number)

Probable cause - Dreamweaver, MS Word, Frontpage or similar application, e.g not a good text editor, has been used to edit snews.php.
Possible solution - Use a good text editor. Tips on good text editors for the big OS's can be found in the Resources area.

---------------------------------------------------------------------------------------------------------------------------------------------------
(submitted by MXMaster, Dec. 15/06)

Error 500 - Internal Server Error - when .htaccess is being used
You have set everything up correctly and have checked you can use your own .htaccess files on your server & have Mod_rewrite enabled yet sNews still doesn't function.

Cause
Sometimes this section of the .htaccess file is not allowed on some web hosts servers:
Quote

    php_value session.use_trans_sid 0
Solution
Try amending the top of the .htaccess file to this:
Quote
#
#    php_value session.use_trans_sid 0
#
Add a # to the first 3 lines of code.

---------------------------------------------------------------------------------------------------------------------------------------------------

If you come across any other Error Messages while setting up or using sNews 1.5, please post them in this Topic using the same format. This will assist other sNoozers in troubleshooting their Error Messages in future.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

David

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 7
  • Posts: 580
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #1 on: December 09, 2006, 06:50:39 PM »

Thank you Keyrocks!  :cool:
Logged

brauck

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 18
  • Posts: 572
    • http://www.hbw-webdesign.nl/
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #2 on: December 09, 2006, 08:50:46 PM »

Nicely done Key. Maybe this should be a sticky
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #3 on: December 09, 2006, 08:55:09 PM »

It is a sticky, Onno ;) although not tagged as one... I'll see to that.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

brauck

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 18
  • Posts: 572
    • http://www.hbw-webdesign.nl/
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #4 on: December 09, 2006, 09:07:31 PM »

:)
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

piXelatedEmpire

  • MIA
  • Thread Moderator
  • ULTIMATE member
  • *****
  • Karma: 37
  • Posts: 1454
  • currently MIA
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #5 on: January 02, 2007, 10:21:06 AM »

This topic is brilliant!  Just installed my first ever sNews website and the errors I encountered where listed here, and the probable scenarios where very useful in troubleshooting the problem.

Cheers keys!
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Dom

  • Full Member
  • ***
  • Karma: 5
  • Posts: 166
    • domdelimar.com
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #6 on: January 02, 2007, 07:37:21 PM »

I agree, this is a brilliant idea. Keep up the good work keyrocks!

Note to Administrators: I just want to point out that the link "Error messages..." from the Notice box (which BTW, is also a brilliant idea!), linking to this page, might be even more usable for all newcomers if it linked to http://www.solucija.com/forum/viewtopic.php?id=2513 as that topic contains more of these error messages and is clean from other comments.
Logged

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #7 on: January 02, 2007, 10:46:26 PM »

Thanks for pointing that out Dom. I've now added the content from those additional posts to my first post (above) with the author's name noted so they are all in one place. I'm sure they won't mind. :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Fabio

  • Newbie
  • *
  • Karma: 0
  • Posts: 10
    • http://www.emodializzati.it
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #8 on: March 03, 2007, 03:13:01 PM »

Thank you.
It will be THE reference
Logged
Free Rapidweaver's templates at
http://www.butella.net

bpj1966

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #9 on: April 10, 2007, 10:13:53 AM »

This topic should not be posted inside problem solving area - please repost your issue in the appropriate section
Logged

jansie

  • Guest
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #10 on: April 18, 2007, 10:17:47 AM »

hi. thanks so much for this key. but... i've come across an error message not logged here. here it is:

Parse error: syntax error, unexpected $end in /home/datacorc/public_html/snews.php on line 967

now i know you'd say it's my editor (i use coffeecup btw), but can it be? it looks like an error in the PHP, not inserted by an editor.
Logged

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #11 on: April 18, 2007, 01:48:18 PM »

Quote from: jansie
hi. thanks so much for this key. but... i've come across an error message not logged here. here it is:
- Parse error: syntax error, unexpected $end in /home/datacorc/public_html/snews.php on line 967

Now i know you'd say it's my editor (i use coffeecup btw), but can it be? it looks like an error in the PHP, not inserted by an editor.
This is a syntax error message string. A syntax error is an error within the line of code within the defined file. In this case... it means something is not correct within line 967 within your snews.php file... and this error basically stops PHP from parsing (reading and interpreting) the rest of the file beyond that point.

When we get a syntax error... the only thing you can do is locate the line with the problem... find the error within the line and correct it. If you have modded that line, then comment it out and copy/paste the un-modded line from your default (virgin master) snews.php file to replace it... save it... and see if your site functions again. If it does... do a comparison between the working string and your modded string... to see where the problem might be.

When it comes to code editors... use one that does not automatically create and inject code for you, unless you can read and understand exactly what the injected code will do. For instance, you cannot simply add HTML within a section of code that is being parsed within an open PHP session. It needs to be modified so that it will be parsed by PHP... or the PHP session must be closed... the HTML inserted... and the PHP session re-opened... so the parsing can continue.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jansie

  • Guest
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #12 on: April 18, 2007, 04:21:20 PM »

hi key

i got the site working. strange thing, it only showed that error a few times, then it went over to the 'cannot connect to database' error message. got that sorted out, so now the site's up and running. you can check out www.datacor.co.za, and rejoice with me in my first CMS, since a lot of credit for this goes to you. thanks again.
Logged

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #13 on: April 18, 2007, 08:07:55 PM »

Congratulations Jansie... it does appear to be working alright. If you are new to working with PHP and MySQL and such... just keep accepting and beating the challenges as you continue on and you'll soon be comfortable. I has no idea what I was doing on my first CMS and I had to pick the biggest, fattest one of them all to learn on. Ten months later, I launched my first Portal. What I learned then helped me get used to sNews pretty quickly. I haven't found one easier to learn than this one. :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

tobto

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 72
    • seo service
[STICKY] - ERROR MESSAGES: Causes and Possible Solutions
« Reply #14 on: April 26, 2007, 09:18:16 AM »

thanks!
Logged
Pages: [1] 2