Re: Maia on centos 8
jjs - mainphrame <[email protected]>
| Newsgroups | gmane.mail.virus.maiamailguard |
|---|---|
| Message-ID | <CABkzw7zAwkPMHTFy0VCSMFSunzAt+ZY5kufCyZWem5rz4OhHFg@mail.gmail.com> |
I had to make a few changes to get mine working -
(in addition to changing the path of html purifier, since pear would
not/could not install it.)
--
diff -urN '--exclude=compiled'
installer/mainphrame_mailguard/php/admin/configtest.php
fixed_php/admin/configtest.php
--- installer/mainphrame_mailguard/php/admin/configtest.php 2020-03-19
17:16:21.170398096 -0400
+++ fixed_php/admin/configtest.php 2020-03-26 20:22:22.896329312 -0400
@@ -145,7 +145,7 @@
if (is_readable($smarty_base)){
$dir = opendir($smarty_base); #open directory
while ($f = readdir($dir)) { #read one file name
- if (!eregi("^\..*$",$f) && $f!=='.' && $f!=='..'){
+ if (!preg_match("/^..$/",$f) && $f!=='.' && $f!=='..' &&
is_dir($f)){
if (is_writable($smarty_base . "/" . $f . "/compiled")) {
continue;
} else {
@@ -458,15 +458,15 @@
// PEAR::MDB2:mysql
if ($have_pear) {
- if (!in_array("mdb2_driver_mysql", $pear_list)) {
+ if (!in_array("mdb2_driver_mysqli", $pear_list)) {
$result = "Not installed. This PHP extension is required in
order to provide " .
- "database abstraction. Use <b>pear install
MDB2#mysql</b> to install this.";
+ "database abstraction. Use <b>pear install
MDB2#mysqli</b> to install this.";
$status = ERROR;
} else {
- $result = "Pear::MDB2#mysql installed";
+ $result = "Pear::MDB2#mysqli installed";
$status = OK;
}
- print_row("PEAR::MDB2#mysql", $result, $status);
+ print_row("PEAR::MDB2#mysqli", $result, $status);
}
diff -urN '--exclude=compiled'
installer/mainphrame_mailguard/php/cache.php fixed_php/cache.php
--- installer/mainphrame_mailguard/php/cache.php 2020-03-19
17:16:23.272410887 -0400
+++ fixed_php/cache.php 2020-03-26 19:52:18.924503732 -0400
@@ -554,7 +554,7 @@
$rectmp = "";
foreach ($to_list as $recipient) {
if (isset($personal_addresses[$recipient]) ||
$domain_default) {
- $rectmp[] = $recipient;
+ $rectmp = $recipient;
}
}
$rows[$count]['recipient_email'] = $rectmp;
--
Jake
On Thu, Mar 26, 2020 at 4:46 PM Janky Jay, III <[email protected]> wrote:
> I'm totally stumped. I just did a diff on my working Maia PHP directory
> against a fresh pull from the technion branch (tag 09eb7e5) and there's
> absolutely no difference (aside from expected stuff like 'config.php' and
> compiled themes). I'm not sure why mine would work with PHP 7.2.29 and
> yours wouldn't.
>
> Regards,
> Janky Jay, III
>
> On 3/26/20 4:55 PM, jjs - mainphrame wrote:
>
> Quick and dirty fix -
>
> Change line 557 of cache.php from this:
> $rectmp[] = $recipient;
> To this:
> $rectmp = $recipient;
>
> and now I can see and display the individual ham and spam messages.
>
> Jake
>
>
> On Thu, Mar 26, 2020 at 3:31 PM jjs - mainphrame <[email protected]>
> wrote:
>
>> For those interested in the old maia code base and php-7.2
>>
>> I've actually managed to get somewhat farther with php-7.2, after a few
>> minor code tweaks.
>>
>> I can log into maia, become another user via admin, and see how many ham
>> and spam they have in the cache.
>>
>> [image: maia-screenshot-2020-03-26.png]
>>
>> But when I click on the ham or spam, php throws an error:
>>
>> Fatal error: Uncaught Error: [] operator not supported for strings in
>> /var/www/html/maia/cache.php:557 Stack trace: #0
>> /var/www/html/maia/list-cache.php(148): MessageCache->render('6') #1 {main}
>> thrown in /var/www/html/maia/cache.php on line 557
>>
>> So I'll have to figure out how that should be re-written for php 7.
>>
>> jake
>>
>> On Thu, Mar 26, 2020 at 2:29 PM jjs - mainphrame <[email protected]>
>> wrote:
>>
>>> You know what, the spam filtering part of maia still works fine on new
>>> distros, or 10 year old distros, so I can manage with the old maia as is,
>>> and just use a dedicated instance of debian 8 (or some other older distro)
>>> just for the web interface.
>>>
>>> If you'd rather be working on maia 2.0 material, I think that would have
>>> better long term prospects.
>>>
>>> Jake
>>>
>>> On Thu, Mar 26, 2020 at 1:31 PM jjs - mainphrame <[email protected]>
>>> wrote:
>>>
>>>> Yes, that simple test doesn't produce an outright failure, but it was a
>>>> place to start. The show stoppers are further down the road, but there may
>>>> be clues here. Thanks for the MDB2 link, I'll test with that.
>>>>
>>>> Jake
>>>>
>>>> On Thu, Mar 26, 2020 at 12:30 PM Robert LeBlanc <[email protected]>
>>>> wrote:
>>>>
>>>>> So far that looks like just deprecated syntax warnings and notices,
>>>>> but nothing that necessarily breaks functionality. I’d expect that with
>>>>> older code that hasn’t been updated for PHP 7—it may still work (you did
>>>>> get to “Success!”), but it’ll generate a lot of complaints in the logs
>>>>> unless you change the log threshold to ignore warnings and notices.
>>>>>
>>>>> According to its “official” changelog, MDB2 was last updated in 2012
>>>>> (v 2.5.0b5), so its maintainers are clearly not going to update it for PHP
>>>>> 7.
>>>>>
>>>>> That said, there’s a GitHub version that seems to be maintained (as of
>>>>> 12 months ago) with PHP 7 fixes:
>>>>>
>>>>> https://github.com/pear/MDB2
>>>>>
>>>>>
>>>>> On Mar 26, 2020, at 11:53 AM, jjs - mainphrame <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Simple test -
>>>>>
>>>>> OK, I'm going back to basics here with a simple test, comparing Centos
>>>>> 7 & php-5.4.16 with Centos 8 & php-7.2.11
>>>>>
>>>>> They both have the same pear MDB2 modules installed. A simple DB
>>>>> connection test was run on both:
>>>>>
>>>>> <?php
>>>>> require_once 'MDB2.php';
>>>>>
>>>>> $dsn = 'mysqli://test:test@dbserv/test';
>>>>> $options = array(
>>>>> 'debug' => 2,
>>>>> 'result_buffering' => false,
>>>>> );
>>>>>
>>>>> $mdb2 =& MDB2:: connect($dsn, $options);
>>>>> if (PEAR::isError($mdb2)) {
>>>>> die($mdb2->getMessage());
>>>>> } else {
>>>>> echo "Success!\n";
>>>>> }
>>>>>
>>>>> $mdb2->disconnect();
>>>>> ?>
>>>>>
>>>>> On Centos 7, it simply returns "Success!"
>>>>> But on Centos 8 it returns this:
>>>>>
>>>>> PHP Warning: count(): Parameter must be an array or an object that
>>>>> implements Countable in /usr/share/pear/MDB2.php on line 826
>>>>>
>>>>> Warning: count(): Parameter must be an array or an object that
>>>>> implements Countable in /usr/share/pear/MDB2.php on line 826
>>>>> PHP Notice: Only variables should be assigned by reference in
>>>>> /root/dbtest.php on line 10
>>>>>
>>>>> Notice: Only variables should be assigned by reference in
>>>>> /root/dbtest.php on line 10
>>>>> Success!
>>>>>
>>>>> Jake
>>>>>
>>>>>
>>>>> On Tue, Mar 24, 2020 at 11:46 AM jjs - mainphrame <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi folks,
>>>>>>
>>>>>> maia works well for me on centos 7, but not on centos 8, with php-7.2
>>>>>>
>>>>>> Actually the perl part is golden, and configtest.pl works fine. But
>>>>>> the php side of things is broken, and configtest.php fails miserably.
>>>>>>
>>>>>> It looks the diverging code bases of php, smarty, pear and maia are
>>>>>> the issue.
>>>>>>
>>>>>> Has anybody had any success getting maia running with php-7.2? If so,
>>>>>> I'd be curious what tweaks you had to make. I found that as installed,
>>>>>> configtest.php says it can't connect to the database, but tcpdump shows
>>>>>> that not a single packet gets sent to the specified db server.
>>>>>>
>>>>>> If nobody has any new info, I guess I'll have to look at the old code
>>>>>> and try to figure out what's broken.
>>>>>>
>>>>>> Jake
>>>>>>
>>>>> _______________________________________________
>>>>> Maia-users mailing list
>>>>> [email protected]
>>>>> http://www.renaissoft.com/cgi-bin/mailman/listinfo/maia-users
>>>>>
>>>>>
>>>>>
> _______________________________________________
> Maia-users mailing [email protected]://www.renaissoft.com/cgi-bin/mailman/listinfo/maia-users
>
>
> _______________________________________________
> Maia-users mailing list
> [email protected]
> http://www.renaissoft.com/cgi-bin/mailman/listinfo/maia-users
>
_______________________________________________
Maia-users mailing list
[email protected]
http://www.renaissoft.com/cgi-bin/mailman/listinfo/maia-users
maia-screenshot-2020-03-26.png
(image/png, 133.4 KB) - not displayed