Spamhurdles not working after upgrade 5.2.22

Posted by marco.troost 
Spamhurdles not working after upgrade 5.2.22
November 02, 2016 01:39PM
Hi,

My (fresh) installation of phorum 5.2.22 breaks on the Spamhurdles module. (as one can see @ http://trauminfo.de/phorum/read.php?2,5 ).

The frustrating thing is that on my localhost (a laravel project in a homestead virtual machine), the phorum upgrade does work (with the spamhurdles module enabled).

I've already checked if the ./cache directory is writable.

Anybody have a clue?

grtz Marco
Re: Spamhurdles not working after upgrade 5.2.22
November 02, 2016 02:00PM
Enable logging in the admin (everything), and/or check the php error log.
Enable logging in spamhurdles.
Force some entries.

Are there any errors or warnings?
Re: Spamhurdles not working after upgrade 5.2.22
November 02, 2016 03:24PM
Hi Scott,

I've enabled event logging for spamhurdles, and it provides the following feedback:

PHP warning: file_exists(): open_basedir restriction in effect. File(./mods/mod_tidy.php/info.txt) is not within the allowed path(s)

Not quite sure though how i can log phorum as a whole though.

regards, Marco
Re: Spamhurdles not working after upgrade 5.2.22
November 02, 2016 04:54PM
Follow up on my own reply:

the open basedir warning was fixed by removing mod_tidy alltogether from de /mods directory.

I'v been able to reproduce PHP errors on my localhost.
These warnings talk of deprecated PHP functions.



Does anybody known if these errors could be the reason Spamhurdles doesn't work?
Re: Spamhurdles not working after upgrade 5.2.22
November 02, 2016 06:14PM
The path in the warning points to a tidy directory >>File(./mods/mod_tidy.php/info.txt) mod_tidy.php has been in the mods directory since at least 2007. Mod tidy has the information in info.txt included in the mod_tidy.php , this shouldn't cause a warning.

You appear to have a permission problem with directories, however check for another copy of mod_tidy.php
You may have had a separately installed mod_tidy leftover from Ver. 5.1.x or earlier.

"Deprecated" is a warning for the future. Warnings are not supposed to prevent php from running.
Quote

Methods called from an incompatible context are now deprecated, and will generate E_DEPRECATED errors when invoked instead of E_STRICT. Support for these calls will be removed in a future version of PHP.

spamhurdles needs a table in the database, is it there?

error logging in php may be set in the php.ini. Depending on your host, you may be able to have your own php.ini
Check your phorum directory for error_log, or ask the host where/if it gets written.
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 02:39AM
Hi S
Thanks for you answer. I've looked into my php error log. The main reason seems to be:

PHP Fatal error: Uncaught exception 'Exception' with message 'There is no suitable CSPRNG installed on your system'.

I gues this is a php extension of sorts that generates something random.

Any ideas how i can fix this?

kind regards, Marco
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 08:18AM
You need access to php.ini, or your host needs to add the extension.
If you use cpanel there may be a link to do it yourself.
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 02:03PM
Hi Scott,

I do have access to php.ini, but i do not known what to place there with regards to open_basedir & CSPRNG

Can you tell me what to do?

grtz Marco

p.s. Perhaps this could provide more insight: my new phorum is placed in the "public" directory of an laravel project.
I use composer.json to include ""paragonie/random_compat": "~1.4" as a dependancy
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 02:44PM
Unable to assist you with your host.

This link may help to understand the problem (even if you are not on php 7). [www.sammyk.me]
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 03:30PM
Hi Scott,

I'm not that much of a sysop, but i finally figured it out.
My gut feeling was that non functioning Spamhurdles had something to do with read-write access, but i didn't know what.

Using these steps provided in http://ourcodeworld.com/articles/read/214/how-to-solve-php-7-0-polyfill-there-is-no-suitable-csprng-installed-on-your-system-paragonie-random-compat

I had to append "/dev/urandom" to my existing open_basedir configuration.
Re: Spamhurdles not working after upgrade 5.2.22
November 03, 2016 03:41PM
Glad it is fixed.
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 02:02AM
Alas, I cheered to soon. After I got the spamhurdles working with the default settings, I wanted to change the style via the admin panel.
After choosing "ascii art" and pressed "save", I got a blank page.

I decided to delete all my phorum tables, and install all new ones.
Now nothing seems to work.

When looking in the errorlogs, this message pups up regularly

PHP Fatal error: Call to a member function update_settings() on null in /home/droominfo/domains/trauminfo.de/public/phorum/mods/spamhurdles/defaults.php on line 140

Very frustrating! Anyone an idea?
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 08:14AM
Was the spamhurdles table created?
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 08:40AM
Now that you mention it: no it wasn't !!
Since spamhurdles is in the default distribution, if figured this table would be automatically created.

I'll try to create the spamhurdles table, see if this helps.
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 09:08AM
@Scott, no still doesn't help.

Even with a table "phorum_spamhudles", my errorlog still returns:

Fatal error: Call to a member function update_settings() on null in /home/droominfo/domains/trauminfo.de/public/phorum/mods/spamhurdles/defaults.php on line 140

:(
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 09:56AM
When you enabled spamhurdles did you save the settings?
"submit" button at bottom of page.
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 10:09AM
I did. A completely new issue popped up: since i created a table "phorum_spamhurdles".

I can't even see the settings-page of the spamhurdles module in the admin section anymore ???


this doesn't seem to work:


// Save the upgraded configuration.
$PHORUM['DB']->update_settings(array(
'mod_spamhurdles' => $PHORUM['mod_spamhurdles']
));



Edited 1 time(s). Last edit at 11/04/2016 10:19AM by marco.troost.
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 12:00PM
What version of mysql are you using?
Did you also upgrade mysql?
Re: Spamhurdles not working after upgrade 5.2.22
November 04, 2016 12:12PM
I seem to have gotten Phorum (with spamhurdles) to work now.
It is superweird though.

Solution: I've ftp'ed the phorum developed on my localhost to my production server.

Before -using git pull- phorum didn't function.
Now -plain ftp'ing- phorum works.

???

I quess all my troubles are more related to git than the source code of phorum itself.
Git is a cool, developy thing to do though.

Does anybody know how to use git to take phorum into production?

grtz Marco
Sorry, only registered users may post in this forum.

Click here to login