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.

Author Topic: PHP Version Issue?  (Read 3128 times)

cpmv2

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
PHP Version Issue?
« on: May 20, 2007, 02:10:43 am »

Hello, well I've had everything working for a while now, and sNews is SO fantastic.

Anyway, I switched my PHP version from 4.4.2 to 5.2.1. BIG MISTAKE. I changed it to run activeCollab which requires PHP 5+.

After switching, sNews won't post my new articles or extra contents, I get the 'Operation Successful' message, but no content appears. Switching back to PHP 4.4.2 all works fine. I know sNews 1.6 and 1.5 say "
PHP: Hypertext Preprocessor version 4.x or above" so I am unsure what the issue is.

I apologize if this has been covered, I did a forum search. Thanks for any guidance.
Logged

Joost

  • Guest
PHP Version Issue?
« Reply #1 on: May 20, 2007, 02:41:43 am »

This could be the 'single quote mark issue' . Test if this is the case, by making a new page or article with single quote marks and one without.
If it is a 'single quote mark issue' then you have several options. What works for me, is adding the following line to .htaccess (or the ini file, if you have access). In php5 magic quotes are disabled by default, but check phpinfo.php first.
Code: [Select]
php_flag magic_quotes_gpc onOr apply this fix http://www.solucija.com/forum/viewtopic.php?id=2594

If the problem is something else, someone else will have to see to that.

Regards
Logged

cpmv2

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
PHP Version Issue?
« Reply #2 on: May 20, 2007, 03:03:13 am »

No, I think this is the issue. WOW! Thanks a ton. The .htaccess tip didn't work. On to the other fix. Thanks again.
Logged

Joost

  • Guest
PHP Version Issue?
« Reply #3 on: May 20, 2007, 03:10:20 am »

Good to hear. Makes me wonder why the .htaccess trick works for me on two different hosts. One using php4.6.6 the other using php5 :rolleyes:
Logged

cpmv2

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
PHP Version Issue?
« Reply #4 on: May 20, 2007, 03:38:14 am »

So it seems this fix:

http://www.solucija.com/forum/viewtopic.php?id=2594

is for 1.5 only? I am running 1.6 with PHP 5.2.1. I suppose I need to get the .htacccess trick working! Yikes.
Logged

Joost

  • Guest
PHP Version Issue?
« Reply #5 on: May 20, 2007, 04:01:39 am »

Quote from: cpmv2
So it seems this fix:

http://www.solucija.com/forum/viewtopic.php?id=2594

is for 1.5 only? I am running 1.6 with PHP 5.2.1. I suppose I need to get the .htacccess trick working! Yikes.
You will have to find the same code lines in 1.6 for it to work.
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
PHP Version Issue?
« Reply #6 on: May 20, 2007, 05:17:03 am »

Have just tested some things...

see if this works for you...

in function processing()
locate
Quote
$text = $_POST['text'];
and make it like
Quote
$text = clean($_POST['text']);
Oh, and if this test works for you, please let us know...
Logged
Of all the things I have lost, it is my mind that I miss the most.

Joost

  • Guest
PHP Version Issue?
« Reply #7 on: May 20, 2007, 06:01:10 am »

@philmoz

Fix worked smoothly  for PHP Version 5.2.1  with magic_quotes_gpc enabled as well as disabled.
I have tested quotes in pages, titles and comments.
Have to test some other things. Report will be extended later
Logged

cpmv2

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
PHP Version Issue?
« Reply #8 on: May 20, 2007, 06:05:24 am »

Well this explains why the .htaccess trick didn't work for me:

"We run php as a cgi instead of apache module, so any php flags you set
in the .htaccess file would be ignored. To turn magic_quotes_gpc on, you
can either downgrade your php version to 4, or, install your own version
of php."

I reverted to PHP 4+ for sNews 1.6, and decided to install a sub-domain running PHP 5+ for activeCollab.

I appreciate the help.

philmoz thanks, maybe that will help someone in a similar situation.
Logged

Joost

  • Guest
PHP Version Issue?
« Reply #9 on: May 20, 2007, 07:15:10 am »

Full report on php 5.2.1
Before fix and magic_quotes off:
No article, no page and no extra, using single quotes.
Comments OK

With fix and magic_quotes off:
Everything ok

With fix and magic_quotes on:
Everything ok
Logged

cpmv2

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
PHP Version Issue?
« Reply #10 on: May 21, 2007, 04:36:13 pm »

Quote from: philmoz
Have just tested some things...

see if this works for you...

in function processing()
locate
Quote
$text = $_POST['text'];
and make it like
Quote
$text = clean($_POST['text']);
Oh, and if this test works for you, please let us know...
This DID work! So cool! Thanks a lot!
Logged

ens

  • Sr. Member
  • ****
  • Karma: 12
  • Posts: 279
    • http://www.meatysite.info
PHP Version Issue?
« Reply #11 on: May 21, 2007, 06:50:36 pm »

Yes, I just had nearly the same issue, solved with the same solution here
Logged