Topic: Fancy Stop SPAM extension and MySQL/PHP compatibility

I am trying to use Fancy Stop SPAM 1.3.54.13 in official PunBB 1.4.6 running on MySQL.

It works well on my local test server with MySQL 5.7.34 and PHP 7.4.21.

But it does not work on my remote deployment server with MySQL 5.1.73 and PHP 5.3.3.

The site setup including the database is the same on both. The only other extension, Stop spam bots, works well on both.

After I enable the Fancy Stop SPAM extension on the remote site, and browse to another forum page, I get only blank pages in the browser.

– the forum pages are blank even if I enable debugging to see error/MySQL queries (through forum config.php)

- disabling extension hooks through config.php re-activates the forum, but of course the extensions are turned off. I can then disable Fancy Stop SPAM on Admin page and the forum works fines.

- I have tried uninstalling and reinstalling the Fancy Stop SPAM extension but this has not helped

- using PHP mysql instead of mysqli does not change result

I wonder if the issue is in some SQL-related coding in Fancy Stop SPAM code. Any thought?

Re: Fancy Stop SPAM extension and MySQL/PHP compatibility

Publish the php errors that appear when the Fancy Stop SPAM extension is enabled. In the errors.log file (approximate name), they should be.

>After I enable the Fancy Stop SPAM extension on the remote site, and browse to another forum page, I get only blank pages in the browser.
>and PHP 5.3.3.

Most likely, this is an incompatibility of php. Therefore, I need to see the errors from the server error log.

ForkBB
I speak only Russian  :P

Re: Fancy Stop SPAM extension and MySQL/PHP compatibility

I have requested the remote server admin for access to PHP/Apache error log.

I can confirm that the extension works fine on my local server in PHP 5.6.10/MySQL 5.5.42 (besides PHP 7.4.21/MySQL 5.7.34).

Re: Fancy Stop SPAM extension and MySQL/PHP compatibility

I saw this limitation for PHP: https://github.com/MioVisman/punbb_exte … st.xml#L15
I do not remember the reason for this restriction sad

PunBB 1.4.4 + Fancy Stop SPAM 1.3.54.13 + PHP 5.4.31 and SQLite 3.7.7.1/MySQL 5.6.20 - works without problems.

P.S. PHP 5.3.3/5.3.7 could not start, Apache swears at them.

ForkBB
I speak only Russian  :P

5 (edited by patnaik 2022-05-04 22:38)

Re: Fancy Stop SPAM extension and MySQL/PHP compatibility

The Apache/PHP error log is below.

Not sure if it helps. I do not see any PHP code issue in fancy_stop_spam.inc.php.

Corrected later: Line 957 of the file uses the short array syntax to declare $patterns. This syntax requires PHP 5.4+. Editing the code block to use $patterns = array(...) instead of $patterns = [...] fixed my issue.

// Extension was previously installed. It caused blank page. So config.php was edited to disable extension hooks. Then extension was disabled on forum admin page.

// Today at 14:47, extension was enabled on forum admin page by clicking on enable link, which caused blank page to appear. Then I just typed URL of different forum pages in browser (forum main page, etc.), which all appeared as blank pages.

[Wed May 04 14:47:08 2022] [error] [client *] PHP Parse
error:  syntax error, unexpected '[' in
*/forum/extensions/fancy_stop_spam/fancy_stop_spam.inc.php
on line 923, referer:
*/forum/admin/extensions.php?section=manage
[Wed May 04 14:47:18 2022] [error] [client *] PHP Parse
error:  syntax error, unexpected '[' in
*/forum/extensions/fancy_stop_spam/fancy_stop_spam.inc.php
on line 923
[Wed May 04 14:47:31 2022] [error] [client *] PHP Parse
error:  syntax error, unexpected '[' in
*/forum/extensions/fancy_stop_spam/fancy_stop_spam.inc.php
on line 923

Re: Fancy Stop SPAM extension and MySQL/PHP compatibility

Thank you! Now I understand why I set the minimum version of php = 5.4.

ForkBB
I speak only Russian  :P