Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: sNEWs on PHP5  (Read 4753 times)

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
sNEWs on PHP5
« on: August 08, 2008, 08:50:36 am »

Hi
Earlier I was using snews on php4 enabled server and it worked perfectly for me.
Yesterday I moved my snews to new hosting account having php5 and I start getting " Internal server error"  :'(

On deleting .htaccess homepage is accessible but other link are not working.

My host is having mod_rewrite enabled.

Do I have to make any changes to .htaccess file to get it working.

Please any suggestions.  :-\



Logged

Ken Dahlin

  • Full Member
  • ***
  • Karma: 30
  • Posts: 139
    • http://www.kendahlin.com/
Re: sNEWs on PHP5
« Reply #1 on: August 08, 2008, 09:21:06 am »

Hi
Earlier I was using snews on php4 enabled server and it worked perfectly for me.
Yesterday I moved my snews to new hosting account having php5 and I start getting " Internal server error"  :'(

On deleting .htaccess homepage is accessible but other link are not working.

My host is having mod_rewrite enabled.

Do I have to make any changes to .htaccess file to get it working.

Please any suggestions.  :-\


The problem is definitely having to do with the .htaccess file then. Either mod_rewrite is not enabled on your server or there is an error in the .htaccess file. If you know for a fact that mod_rewrite is enabled, try making sure you're using a standard snews issued .htaccess with rewritebase set correctly if your install is in a subdirectory.

If your sNews is installed in the "root" of your domain, try RewriteBase /

-- I have to do that on one of my servers otherwise I get a 500 error too. Good luck
Logged

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #2 on: August 08, 2008, 03:40:15 pm »

Thanks for reply Ken.
But I am not able to get thru.

Yes my host have mod_rewrite enabled as I am using wordpress and other application with clean URLs.


Really don't know what to do as my host suggests that I should check the .htaccess syntax but all in vain.

Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNEWs on PHP5
« Reply #3 on: August 08, 2008, 04:15:13 pm »

Thanks for reply Ken.
But I am not able to get thru.

Yes my host have mod_rewrite enabled as I am using wordpress and other application with clean URLs.
Really don't know what to do as my host suggests that I should check the .htaccess syntax but all in vain.

If your project's file-set is within your domain root (not in a folder in the domain root), then your .htaccess file should be OK in its default form.
If you put your file-set in a folder in the domain root, then you need to enable the Rewrite string in the file and add your folder-name to it.
If this isn't working, download a copy of the .htaccess file as it is from your domain server... and examine it to see that it is still exactly the same as the one you had uploaded. We have (in the past) had cases where a host server already had its own host-created .htaccess file in the domain root and it would always over-write the sNews .htaccess file or not permit the sNews one to replace it.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #4 on: August 11, 2008, 08:06:20 am »

Once again thanks for the support but still the problem is same.
One more question I would like to add here is anyone tried to setup snews with IXwebhost (php5), reason for that I am not able to host snews on there servers.

@KEYROCK :

My sNews installation is in root i.e domain.com so no rewritedbase used. Though I tried RewriteBase / ( just for testing )

Any suggestions ?






Logged

Joost

  • Guest
Re: sNEWs on PHP5
« Reply #5 on: August 11, 2008, 09:15:23 am »

Try something like :

Code: [Select]
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
Logged

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #6 on: August 12, 2008, 09:01:16 am »

Thanks Joost but it didn't worked. But I just checked my error log which reads :-

[Tue Aug 12 02:55:27 2008] [error] [client 192.168.67.1x] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.

Hope this will be useful to resolve the issue.

Thanks again to all who are trying to help me out.
Logged

Joost

  • Guest
Re: sNEWs on PHP5
« Reply #7 on: August 12, 2008, 09:21:34 am »

Some servers require this in the htaccess file as well, to make mod_rewrite work:
(put it before rewrite code)

Options +FollowSymLinks
Logged

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #8 on: August 12, 2008, 09:30:02 am »

 :'( :'( :'(

No..

This is what my .htaccess looks like

#<IfModule mod_php4.c>
#    php_value session.use_trans_sid 0
#</IfModule>
Options +FollowSymLinks
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L]

Is there any line in this htaccess which is creating the ENDLESS LOOP so I am getting a maximum number of internal redirects reached.. error..

Logged

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #9 on: August 27, 2008, 02:05:43 pm »

Hi Keyrocks / Joost

Guys if you can help me out. In continuation to the problem, I removed few line of .htaccess and it started working partially. So definately the problem lies with .htaccess rather webserver ( pure guess )

Ok this is how my .htaccess look like now after removing few lines.

Options +FollowSymLinks
# <IfModule mod_php4.c>
    # php_value session.use_trans_sid 0
# </IfModule>
RewriteEngine On
RewriteBase /
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L]

I removed following lines:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d

Here is partially what working for me :

Only few post I can able to rewrite ( working fine ), but not all ( strange )
I can't rewrite the CATEGORY, getting a 404
On clicking latest comments a post is appearing


 :-\
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNEWs on PHP5
« Reply #10 on: August 27, 2008, 03:33:26 pm »

When it comes to .htaccess directives... my pen runs out of ink so I'm not much help with this.
However, the issue over redundant lines in the file has been discussed here and I have been running a couple of snews-powered sites without problems - on servers running PHP 5.2.6 with the following in my .htaccess file (only the black is active):

Quote

</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
#RewriteBase /callander.ca2
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
# -------------------------------------------------------
# Next 6 lines don't appear to be necessary in sNews 1.6
# see - http://snewscms.com/forum/index.php?topic=6306.0
# -------------------------------------------------------
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L]


« Last Edit: August 27, 2008, 03:35:52 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

daksh

  • Newbie
  • *
  • Karma: 0
  • Posts: 7
Re: sNEWs on PHP5
« Reply #11 on: August 27, 2008, 04:21:24 pm »


 :D  :D  :D  :D  :D  :D  :D

I am thru..............

Thanks everybody. Thanks Joost, Thanks KeyRocks, Thanks everybody.
I made few more changes to  my .htaccess and it worked.
Though I am not sure whether in future it can lead to problem or not.
Suggestions are most welcome.

here is how my .htaccess look likes
Code: [Select]

<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L]


Basically I removed 3 instances of RewriteCond %{REQUEST_FILENAME} !-d   to 1

and finally I love sNEWs...
Thanks to the developers.
« Last Edit: August 28, 2008, 05:33:28 pm by Keyrocks »
Logged