[SOLVED] Fatal Error: posting.php on line 554

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785

[SOLVED] Fatal Error: posting.php on line 554

Postby chodviolin » Tue Jul 26, 2005 6:59 pm

Originally posted at http://www.benchodroff.com/blog/index.php/2005/07/26/phpbb_posting_php_on_line_554
Keep getting this error in phpBB 2.0.17 with PHP 5.1.0_beta-r2

Fatal error: Only variables can be passed by reference in posting.php on line 554

Here is how I fixed it:
Edit includes/functions_search.php
Starting on line 112:
Code: Select all
       $search_raw_words = array();
        $tempA= clean_words('post', $post_text, $stopword_array, $synonym_array);
        $search_raw_words['text'] = split_words($tempA);
        $tempB= clean_words('post', $post_title, $stopword_array, $synonym_array);
        $search_raw_words['title'] = split_words($tempB);

        @set_time_limit(0);


And in posting.php, starting on line 552
Code: Select all
                      $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
                                $temp1=str_replace("\'", "''", $username);
                                $temp2= str_replace("\'", "''", $subject);
                                $temp3=str_replace("\'", "''", $message);
                                $temp4= str_replace("\'", "''", $poll_title);
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, $temp1, $temp2, $temp3, $temp4, $poll_options, $poll_length);


This error is because of PHP 5.1.0_beta-r2 does not allow function return values to be passed be reference. Actually, PHP was never supposed to allow this...but it kind of slipped through the cracks(?).

All I did was create temporary variables to hold the return values before passing them into a function that passes them by reference.

--Benjamin Chodroff
chodviolin
Registered User
 
Posts: 1
Joined: Tue Jul 26, 2005 5:43 pm

Postby robinek » Tue Aug 02, 2005 9:25 pm

Thx, you da man. It really works and helps me a lot.
robinek
Registered User
 
Posts: 6
Joined: Fri Jun 10, 2005 2:25 pm

Postby lukelast » Tue Aug 16, 2005 3:47 am

There's also another patch needed to use Search.

In search.php line 260.
Code: Select all
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  split_words($temp1=clean_words('search', $temp2=stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);   


Notice how I added "$temp1=" and "$temp2=".

It would be nice if the PHP 5.1 problems were fixed in the next PHPBB2 patch.
lukelast
Registered User
 
Posts: 6
Joined: Sun Feb 27, 2005 1:19 am

Postby Marshalrusty » Tue Aug 16, 2005 3:49 am

PHP5 is not supported and more than these edits would have to be made. It will be supported in the next major release.
Yuriy Rusko

Like what I do? Send a Kudo my way
User avatar
Marshalrusty
Support Team Leader
Support Team Leader
 
Posts: 26245
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City

Postby lukelast » Tue Aug 16, 2005 3:53 am

Well then I can't wait for PHPBB2.2/3.0 to be finished. It really has some nice new features.
lukelast
Registered User
 
Posts: 6
Joined: Sun Feb 27, 2005 1:19 am

Postby Harrowed » Sun Sep 04, 2005 10:43 am

Didn't like lukelast's solution.. The following is much nicer ^_^

search.php :: line 260
Code: Select all
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);


became ::
Code: Select all
if (!strstr($multibyte_charset, $lang['ENCODING']))
{
   $temp1 = stripslashes($search_keywords);
   $temp2 = clean_words('search', $temp1, $stopword_array, $synonym_array); $split_search = split_words($temp2, 'search');
}
else
   $split_search = split(' ', $search_keywords);
Harrowed
Registered User
 
Posts: 1
Joined: Sun Sep 04, 2005 10:35 am
Location: Adelaide, Australia.

Re: [SOLVED] Fatal Error: posting.php on line 554

Postby Traeonna » Tue Sep 20, 2005 9:45 pm

For those who didn't understand what was going on above...here it is spelled out. I used the second fix (search.php) because the first (includes/functions_search.php) gave me an error. Thanks to everyone who figured out the fixes and posted them!!!

OPEN posting.php
FIND
Code: Select all
            $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

            submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);


REPLACE WITH
Code: Select all
$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
                                $temp1=str_replace("\'", "''", $username);
                                $temp2= str_replace("\'", "''", $subject);
                                $temp3=str_replace("\'", "''", $message);
                                $temp4= str_replace("\'", "''", $poll_title);
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, $temp1, $temp2, $temp3, $temp4, $poll_options, $poll_length);


OPEN search.php
FIND
Code: Select all
         $split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);   

REPLACE WITH
Code: Select all
if (!strstr($multibyte_charset, $lang['ENCODING']))
{
   $temp1 = stripslashes($search_keywords);
   $temp2 = clean_words('search', $temp1, $stopword_array, $synonym_array); $split_search = split_words($temp2, 'search');
}
else
   $split_search = split(' ', $search_keywords);
Traeonna
Registered User
 
Posts: 2
Joined: Sun Apr 17, 2005 2:53 am

Re: [SOLVED] Fatal Error: posting.php on line 554

Postby roksopp » Thu Sep 22, 2005 9:04 am

chodviolin wrote:Originally posted at http://www.benchodroff.com/blog/index.php/2005/07/26/phpbb_posting_php_on_line_554
Keep getting this error in phpBB 2.0.17 with PHP 5.1.0_beta-r2

Fatal error: Only variables can be passed by reference in posting.php on line 554

Here is how I fixed it:
Edit includes/functions_search.php
Starting on line 112:
[code]


And in posting.php, starting on line 552
[code]


--Benjamin Chodroff



It doesn't seem to work on my side after I used the way above.
Instead, I have the error as follows:


Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\Program Files\Apache Group\Apache2\htdocs\phpBB2\posting.php on line 2

Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\phpBB2\posting.php on line 2

Is anyone can be nice to tell me how to deal with it.
Thanks to anwer my question, and any advice is appreciated.
roksopp
Registered User
 
Posts: 4
Joined: Thu Sep 22, 2005 7:52 am

Postby roksopp » Thu Sep 22, 2005 9:54 am

by the way.
The envionment of my computer is : win server2003 + apache2 + php5+phpbb2.0.17.

Thanks in advance
roksopp
Registered User
 
Posts: 4
Joined: Thu Sep 22, 2005 7:52 am

Postby MajfA^ » Fri Sep 23, 2005 2:40 pm

i did
Code: Select all
OPEN posting.php
FIND
Code:

            $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

            submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);



REPLACE WITH
Code:
$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
                                $temp1=str_replace("\'", "''", $username);
                                $temp2= str_replace("\'", "''", $subject);
                                $temp3=str_replace("\'", "''", $message);
                                $temp4= str_replace("\'", "''", $poll_title);
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, $temp1, $temp2, $temp3, $temp4, $poll_options, $poll_length);


OPEN search.php
FIND
Code:

         $split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);   


REPLACE WITH
Code:
if (!strstr($multibyte_charset, $lang['ENCODING']))
{
   $temp1 = stripslashes($search_keywords);
   $temp2 = clean_words('search', $temp1, $stopword_array, $synonym_array); $split_search = split_words($temp2, 'search');
}
else
   $split_search = split(' ', $search_keywords);



and i have
Code: Select all
Parse error: parse error, unexpected ';' in /mnt/storage/users/m/a/j/majfa/phpBB2/posting.php on line 552
MajfA^
Registered User
 
Posts: 2
Joined: Fri Sep 23, 2005 2:12 pm

Postby sempai » Fri Sep 23, 2005 4:37 pm

I'm also having the same problem MajfA^ had mentioned, kinda surprised when our hosts changed the PHP version. Need some help, my members wanted to post on my forum. :cry:
Dual! Parallel Trouble Adventure Fan Site
http://dualfans.host.sk
User avatar
sempai
Registered User
 
Posts: 58
Joined: Tue May 20, 2003 3:15 am

Postby Lumpy Burgertushie » Fri Sep 23, 2005 5:16 pm

and that is all why php5 is not supported. whether it works or not depends on too many variables. some server setups will work, some will work for a while and then quit, some will work partly, some won't work at all.

therefore, you are on your own if you use php5.

luck,
robert
Private support on a donation basis. PM me.
Image
NEW phpBB2 SUPPORT SITE
User avatar
Lumpy Burgertushie
Registered User
 
Posts: 34784
Joined: Mon May 02, 2005 3:11 am

Postby MajfA^ » Fri Sep 23, 2005 9:36 pm

I understand... my forum use php5 and i have phpBB 2.0.17 on server www.host.sk How and where can i downgrade to php4?(sorry for question it's my first forum)
MajfA^
Registered User
 
Posts: 2
Joined: Fri Sep 23, 2005 2:12 pm

Postby sempai » Fri Sep 23, 2005 9:47 pm

MajfA^, our hosts are the same too. :cry: and there's nothing we can do about it until PhpBB team released the next version very soon.

To the support team, help us of what we can do. :cry:
Dual! Parallel Trouble Adventure Fan Site
http://dualfans.host.sk
User avatar
sempai
Registered User
 
Posts: 58
Joined: Tue May 20, 2003 3:15 am

Postby JadeFist » Mon Sep 26, 2005 3:41 pm

My webhost did the migration regardless of any known issues with forum scripts. I did follow the steps found here:

http://www.phpbb.com/phpBB/viewtopic.php?p=1762738

and they worked for me so far.
All The Best,
Admin JadeFist
FTTGuild.com
Legends Of Old
User avatar
JadeFist
Registered User
 
Posts: 25
Joined: Fri Apr 05, 2002 12:25 am
Location: AR, USA

Next

Return to 2.0.x Support Forum

Who is online

Users browsing this forum: No registered users and 4 guests