Upgrade from 15 > 18.0.4 server 500 errors

Hi,
I was on v15 (some point version) and between the last time I installed Dolibarr and this month’s end-of-month billing where I use Dolibarr, I’d changed from PHP 7.4 to 8.1 because other sites on my server needed it. I went into Dolibarr and was having weird problems (still v15) so I noticed that the world had moved on to v18.0.4. So I went through the process of migrating from v15 to v18.0.4. This migration was done on PHP v8.1. My v18.0.4 was basically giving me 500 errors left and right and finally just gave me white screens.

I bumped my PHP back to 7.4 and I could re-log into my dolibarr v18.0.4.

The problem is that I can’t stay on PHP 7.4 I need to move to v8.1 for my other sites.

So my question is, did my Dolibarr migration from v15 to v18.0.4 get messed up because I did it on PHP v8.1? If so, is there a way to fix things? I needed to get my billing out so I went ahead and did it on the Dolibarr 18.0.4 running on PHP 7.4. If I restore from backup BEFORE I migrated to v18.0.4 I won’t have my new invoices on it.

Any thoughts from any experts out there as to what I could look at or steps I could take to get out of this mess?
Many thanks!

Hi @dleigh
If everything works with PHP 7.4 I think there is no problem with your installation.
You can use PHP 7.4 only for Dolibarr until v 19.0.0 is out!
You have to create a .htaccess file with content like this

FcgidWrapper "/home/httpd/cgi-bin/php74-fcgi-starter.fcgi" .php
FcgidWrapper "/home/httpd/cgi-bin/php74-fcgi-starter.fcgi" .html
FcgidWrapper "/home/httpd/cgi-bin/php74-fcgi-starter.fcgi" .htm
<FilesMatch "\.(html|htm)$">
 SetHandler fcgid-script
</FilesMatch>

and place it inside your htdocs folder.

Depending on your environment, path maybe different, Google it or ask your provider if any.
Have a happy new year!

Thank you so much for your reply. I really need to go to PHP 8.1 so I don’t want to stay on 7.4 if I don’t have to. I just tried going back to 8.1 and it’s a white screen again. So I’m stuck on 7.4 unless someone can tell me what to change to make 8.1 work for 18.0.4 'cause it’s not working for me.

Sorry I wasn’t clear enough, this way you keep server on PHP 8.1 and only Dolibarr on PHP 7.4
You have to check your logs to see what is wrong with PHP 8.1 maybe an external module is causing the problem!

No, you were very clear - sorry. I just read it too fast. :roll_eyes: Excellent idea. Thanks!

I wasn’t seeing anything in the logs (that I could find) that told me anything. I think I’ll have to open a ticket with my hosting company to ask about that.
Thanks again!

So, I was able to go to my cPanel and change the PHP options to “display errors” and, with the PHP version of 8.1, I saw this: (my home directory redacted)

Fatal error: Uncaught Error: Undefined constant "DOL_DATA_ROOT/dolibarr.log" in 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php:120 Stack trace: #0 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php(120): constant() #1 
/home/********/sites/doliUSA/core/lib/functions.lib.php(1876): mod_syslog_syslog->export() #2 
/home/********/sites/doliUSA/main.inc.php(973): dol_syslog() #3 
/home/********/sites/doliUSA/admin/modules.php(37): require('
/home/********/si...') #4 {main} thrown in 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php on line 120

Fatal error: Uncaught Error: Undefined constant "DOL_DATA_ROOT/dolibarr.log" in 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php:120 Stack trace: #0 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php(120): constant() #1 
/home/********/sites/doliUSA/core/lib/functions.lib.php(1876): mod_syslog_syslog->export() #2 
/home/********/sites/doliUSA/core/lib/functions.lib.php(502): dol_syslog() #3 [internal function]: dol_shutdown() #4 {main} thrown in 
/home/********/sites/doliUSA/core/modules/syslog/mod_syslog_syslog.php on line 120

So I switched back to PHP 7.4 and switched off the debug logging module (which was listed as version 18.0.4) and then I could leave PHP version 8.1 in place.

I don’t really need debug logging right now, but hopefully I won’t until that gets fixed.

At any rate, I’m good now with version 18.0.4 of Dolibarr working with PHP v8.1

Thanks for your help @sonikf

Hi @dleigh
I can confirm the bug,
Could you please open a Bug report for this to get fixed

it affects 19beta also

You can keep debug logging with PHP v8.1 with this configuration


.

The value you are using into field “Facility” is wrong. It can’t accept a path of a file. You must use for example “LOG_USER”

I’ve never changed it so it just was what was in there. Didn’t crash in version 15.

:+1: V18.0.4 turning on debug module crashes Dolibarr with Fatal error: Uncaught Error: Undefined constant "DOL_DATA_ROOT/dolibarr.log" · Issue #27280 · Dolibarr/dolibarr · GitHub

Hi @eldy,
“DOL_DATA_ROOT/dolibarr.log” is autofilled in field “Facility”
I’ ve confirmed it also by creating a clean 18.0.4 instance.