FRDK Design & Kommunikation

Troubleshooting

Sometimes errors will happen, in spite of best intentions. Here’s a run-down of the more common error messages that might occurr when using sNews, their possible causes and fixes .

★ Your home page is unstyled and/or links don’t work

Most likely you haven’t entered the site URL correctly in snews.php, Database variables, [‘website’]. The URL must have a trailing slash at the end (“http://domain-name.tld/site/"). Another possible reason is that your .htaccess file does not contain the correct information—this is especially important if you have installed snews in a subfolder to the root. For example, if you have installed snews in a local MAMP environment, in a subfolder to the MAMP root, the .htaccess info needs to include the following string:

RewriteBase /foldername-of-snews-installation

This string translates as (MAMP root folder)/name of folder where snews and this .htaccess file are located. Remember to always include the .htaccess file in the same folder as snews.php and index.php, regardless if the installation is on the domain root or not.

Another possible reason might be that your server’s Apache httpd.conf file is not properly configured. If the problem occurrs on your web server you will most likely have to ask your domain host if the httpd.conf file has the following parts and that none of them are commented out:
(~line 286) LoadModule rewrite_module modules/mod_rewrite.so
(~line 291) AddType application/x-httpd-php .php .phtml
(~line 377) <Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>

If the problem appears in local environment, do a search for “httpd.conf”, it should be in an Apache library folder, either on the root level or in your User folder. When using MAMP, you find the file in MAMP/conf/Apache/.

★ There was an error while connecting to the database

If you get this message when you access your site, it means that the database name, user name and/or password don’t match between the database and snews.php. You fix it by checking that the details you entered in snews.php are the same as you entered when you created the database. Note that db username and db password should not be confused with the admin username and password.

★ mysql_connect errors

*******************************************************************************************
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 are incorrect. Make sure that these settings are exactly as those in the database you created.

★ 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 – see a comprehensive list on snewscms.com.

★ (500) Internal server error

Probable cause - Your host’s Apache setup only allows mod_rewrite directives in .htaccess, sometimes displayed in the server log as “php_values not allowed here”.

Possible solution - Comment out the first three lines in sNews’ .htaccess file, see example below [courtesy of MXMaster].
#<IfModule mod_php4.c>
# php_value session.use_trans_sid 0
#</IfModule>

Report errors

If you run into problems you can’t solve, or get error messages you don’t understand, post them in the sNews forum. Just be sure to give as many details as you can about your setup, what you were attempting, and what kind of error message you’re getting.

1

evR said (9 Feb, 2008):

Thanks :)

HomeBlog » sNews » Troubleshooting

▾ Flip Extras