Making phpBB2 working with PHP5

»»»Making phpBB2 working with PHP5
Officially, phpBB 2 (as of this writing, up to version 2.0.17) is not supporting PHP 5. If you install PHP 5, and use it to run phpBB, you will encounter the following symptoms and errors:

  • You cannot post message – When you want to post new topic or reply to a topic, after writing your message, when you click “Submit”, a blank page or screen or error message is shown with address bar showing posting.php, instead of posting confirmation message.
  • You unable to search – When you want to search by clicking oh “Search”, no search results are been returned, or a black page or screen, or error message is shown.

To enable PHP 5 to work properly with phpBB, some changes to the phpBB source code needs to be done. Just follow steps as below:

OPEN
admin/admin_ug_auth.php

FIND
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id][$auth_field]) )

REPLACE WITH
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id]) )

FIND
( !isset($auth_access[$forum_id][$auth_field]) && !empty($change_acl_list[$forum_id][$auth_field]) ) ) ||

REPLACE WITH
( !isset($auth_access[$forum_id][$auth_field]) && empty($change_acl_list[$forum_id][$auth_field]) ) ) ||

Finally, some changes are needed so that functions that get called with functions as parameters are not called ‘by reference’ with functions:

OPEN
includes/functions_post.php

FIND
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)

REPLACE WITH
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)

OPEN
includes/functions_search.php

FIND
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)

REPLACE WITH
function clean_words($mode, $entry, &$stopword_list, &$synonym_list)

FIND
function split_words(&$entry, $mode = ‘post’)

REPLACE WITH
function split_words($entry, $mode = ‘post’)

For the above, the changes involved are some parameters have been stripped off the “&” sign.

By |2016-12-09T08:43:38+00:00December 9th, 2016|Categories: Web Servers|Tags: , |4 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.