1 (edited by Zilvermeeuw 07/06/2022 05:50:43 am)

Topic: PHP 8

Hi,

FA is working on PHP 5.6.
FA is not working in PHP 7 or PHP 8.
Probably because there are calls to "mysql_connect", in stead of "mysqli_connect". The "mysql_connect" is removed in PHP 7.*. So also in not available in PHP 8.

If I translate all mysql to mysqli of all db calls, does FA work on PHP 8?
Or are there more things to change?

Or is the FA team already working on this?

2 (edited by Zilvermeeuw 07/06/2022 06:27:02 am)

Re: PHP 8

Euh.....

I am working with several containers.
In the PHP8 container, I did an install of php_mysqli. But after a restart of the container, these changes were lost and forgotten.

After installing php_mysqli again, FA seams to work. I see some minor warnings about deprecated things in PHP 8, but it works.
I did not yet tested everything.

I tried to kick myself on the head, fortunately, I am not flexible enough.

Re: PHP 8

Seems like you didnt read the system requirement,  now a days all servers are updated to new php versions.  So go with new one and try install there. May of us using php 8 for FA. 

If you still get issues. Bring us the issues. Will try to help you on it .

Subscription service based on FA
HRM CRM POS batch Themes

Re: PHP 8

You are correct. I did not read the system requirement. Probably, I am too stupid to find it ;-)

All is working in a container, no errors.

Just for other readers:
I had one issue about the language. Inside the container I installed the dutch language pack. "locale -a" gives: "nl_NL.utf8". Other codings are not available.
I opened the PO file from the FA installation and saved it with PoEdit to UTF-8 format.
In "installed_languages.inc", I changed the encoding to "UTF-8". Now the dutch language is working in FA.

5 (edited by seahawk 09/05/2022 07:50:37 am)

Re: PHP 8

PHP 8 on 2.4.12 Invoice printing and email issue. The invoice does not want to print or email.

It shows that it was emailed, but it is never received.

On print, it just hangs.

When I revert back to PHP7.4 it prints and email.

Please advise.

Wynand

Re: PHP 8

enable debugging mode and get the errors displayed in PHP 8.

Subscription service based on FA
HRM CRM POS batch Themes

Re: PHP 8

FA 2.4.14 is still not sending invoices on PHP8. It shows in green that the invoice was emailed, but nothing is received. All the websites that I run have now been updated to PHP8 since PHP7 has stopped any maintenance or security issues.

Since it is showing that the invoice was sent, but nothing is received it does not show any error.

When I revert back to PHP7 it emails the invoice without issues.

There are two places where you can email the invoice, on the sales tab after you created an invoice and then from the reports tab/ Invoices/email. None of the two is sending the invoices when PHP8 is activated.

.

Wynand

Re: PHP 8

Sending invoices with PHP 8 works for me, so the problem is neither FA or PHP 8.

If FA shows the invoice was mailed in green, it means that your mailer returned success.

Because you are able to send with PHP 7 and not PHP 8, you may have some differing mailer setting in your php.ini file for each version.

If the php.ini files are identical, then you need to enable debug on your system mailer to see exactly what and where the email was sent.  You could compare the mailer debug output when running PHP 7 and PHP 8.

If there is no difference in mailer debug output, then you have run out of options to find the problem.

Sorry if this post is not of much help.

Re: PHP 8

How do i add sales area filter to the report 107 file

Re: PHP 8

How do i add sales inventory location  filter to the report 107 file

Re: PHP 8

Braath Waate wrote:

Sending invoices with PHP 8 works for me, so the problem is neither FA or PHP 8.

If FA shows the invoice was mailed in green, it means that your mailer returned success.

Because you are able to send with PHP 7 and not PHP 8, you may have some differing mailer setting in your php.ini file for each version.

If the php.ini files are identical, then you need to enable debug on your system mailer to see exactly what and where the email was sent.  You could compare the mailer debug output when running PHP 7 and PHP 8.

If there is no difference in mailer debug output, then you have run out of options to find the problem.

Sorry if this post is not of much help.

Thanks, Breath will try and figure it out then.

Wynand

Re: PHP 8

I have now played around with the CPANEL PHP settings for the subaccount for FrountAccounting. There are no mail settings. I am now getting the invoice email when PHP is set to PHP8.0, but it is all in plain text, no pdf attached.

On my test client, I receive two emails, one to me as admin and one to me as the client. On PHP8 however, I either do not get anything or now just receive a client email in Text, not pdf.

I am now at the end of struggling and will have to move my FA installation to a sub-domain with PHP7.4 enabled until I have time to figure this out since for the rest of my site I need PHP8 for both Joomla and Moodle.

Wynand

13 (edited by seahawk 12/19/2022 01:00:28 pm)

Re: PHP 8

I presume that FA is using the file class.mail.inc

This file has not been updated since 2004.

I am still searching to see if there is a difference between 7.4 PHP mail() function and that of PHP8.

Mail from my Joomla4 installation and plugins and Moodle 4.1 on PHP8 are all sending emails without a problem. It is only my FA that has an issue with the PHP change.

What I could trace is the following:

"In PHP 8.0 there was a change to only explode email headers only on CRLF where previously it was exploded on LF and CRLF:

Wynand

Re: PHP 8

Out of some more research, I found the following on PHP bug tracker that might help:

A comment on PHP bug tracker also seems to enforce the fact that PHP 8 would not be tricky-compliant : https://bugs.php.net/bug.php?id=81158

This PHP issue may also be related, as it is mentioned to work with PHP 7.4 but not on PHP 8.0, because of LF char in headers : https://github.com/php/php-src/issues/7902 .

If I understand correctly, the "mail" function is replacing CRLF characters by LF characters, because some MTA may misinterpret CRLF and convert CRLF into CRCRLF.

I am not a programmer so I am merely trying to find a solution that could work on FA.

Wynand

Re: PHP 8

I found a solution for the reporting/includes/class.mail.inc

I have found the solutions by changing all the \n code in the file to \r\n and it works on both PHP7.4 and PHP8.0

Emails are now sending and displaying correctly when sent from FA.

\r\n is for a new line in windows as for \n in the new line in Linux.

Use \r\n instead of \n for your implode -- explicitly specifies CRLF as the line terminator.

Wynand

Re: PHP 8

After updating to FA 2.4.16, found that this email issue raised its head again. When I change the reporting/includes/class.mail.inc file to my changes made as indicated above, it sends correctly to me and the client.

It sends a plain coded email mail that looks like this small extract

JVBERi0xLjMKMS4wMCB3CjMgMCBvYmoKPDwvVHlwZSAvUGFnZQovUGFyZW50IDEgMCBSCi9N
ZWRpYUJveCBbMCAwIDU5NS4yOCA4NDEuODldCi9SZXNvdXJjZXMgMiAwIFIKL0NvbnRlbnRz
IDQgMCBSPj4KZW5kb2JqCjQgMCBvYmoKPDwvRmlsdGVyIC9GbGF0ZURlY29kZSAvTGVuZ3Ro
IDE1Mzc+PgpzdHJlYW0KeJzVWltz0zgUfu+vOC/MwkxjJFvypU8kTdoNA6W0WZZd4EHEamuw

Nothing is attached to the email.

Wynand

Re: PHP 8

The base64 dedoded string of the above is a PDF file that comes out from https://www.base64decode.org/ as:

%PDF-1.3
1.00 w
3 0 obj
<</Type /Page
/Parent 1 0 R
/MediaBox [0 0 595.28 841.89]
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 1537>>
stream
xZ[s8~8/Lc$[O$M
Y]Ajk

18 (edited by seahawk 07/19/2023 10:01:48 am)

Re: PHP 8

Once I change the coding on the Rep17, it sends the pdf as an attachment. When emailing an invoice or any document, it creates this code inside the email. Cannot send that to the clients.

It is the emailing function in FA that creates the issue.

Relating to the following post:



I found a solution for the reporting/includes/class.mail.inc

I have found the solutions by changing all the \n code in the file to \r\n and it works on both PHP7.4 and PHP8.0

Emails are now sending and displaying correctly when sent from FA.

\r\n is for a new line in windows as for \n in the new line in Linux.

Use \r\n instead of \n for your implode -- explicitly specifies CRLF as the line terminator.

When I change this in the lass.mail.inc it send correctly on PHP8

Wynand