Hi! Happy new year!
We have found a deprecated message installing the 14v with php 8.1.1
Deprecated : Function strftime() is deprecated in /var/www/html/core/modules/syslog/mod_syslog_file.php on line 176
We have created a small patch to fix it… Enjoy it!!!
Processing: mod_syslog_file.patch…
mod_syslog_file.txt (857 Bytes)
ksar
January 2, 2022, 10:20am
#2
Hello,
Thank you but you will have a lot more than this one. Dolibarr V14 is not compatible php V8
baumesa
January 2, 2022, 10:43am
#3
Hi!
It works fine with php 8.1.1 for me
I use official docker image in production mode.
This is an example of dockerfile
FROM php:8.1.1-apache
RUN \
apt-get update && \
apt-get install -y libzip-dev zlib1g-dev libpng-dev libonig-dev libicu-dev
RUN docker-php-ext-install calendar mysqli gd zip mbstring intl
ENV dolibarr_version 14.0.4
COPY dolibarr-${dolibarr_version}.tgz /tmp
RUN tar -xzf /tmp/dolibarr-${dolibarr_version}.tgz -C /var/www/html --strip 2 dolibarr-14.0.4/htdocs
RUN rm /tmp/dolibarr-${dolibarr_version}.tgz
COPY patch/mod_syslog_file.patch /tmp
RUN patch /var/www/html/core/modules/syslog/mod_syslog_file.php < /tmp/mod_syslog_file.patch
RUN rm /tmp/*.patch
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN chown -R www-data.www-data /var/www/html
i have the same issue with the date / time stamp
but how to fix this with patch , im new with php.
priojk
January 3, 2022, 1:06pm
#5
Hello,
if you want to use Dolibarr in a production environment (i.e. not just for testing), it is strongly recommended to use a version of php which is in the recommended range. For current releases this is between version 5.6 and 7.4.
Run this command.
patch /var/www/html/core/modules/syslog/mod_syslog_file.php < [patch file name]
Thank you for your comment.
But…
Active support for php 7.4 ended on Nov 28, 2021, and security patches will be discontinued on Nov 28, 2022. https://www.php.net/supported-versions.php
So I can take the risk that there is a small bug in php 8, compared to having a serious security problem due to old software.
ksar
January 3, 2022, 1:43pm
#8
Dolibarr V15 will be compatible PHP V8, should be out end of this month
sorry for the question, run from where
baumesa
January 4, 2022, 9:40pm
#11
Hi, no problem.
You should execute this command inside your linux server.
Another possibility, you could change manually the file core/modules/syslog/mod_syslog_file.php changing the line:
$message = strftime("%Y-%m-%d %H:%M:%S", time()).$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
by the new
$message = date("Y-m-d H:i:s", time()).$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
baumesa:
date("Y-m-d H:i:s", time()).$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
i did changeline but not changed any thing