Updates needed for PHP 8.1

521 views
Skip to first unread message

w1djm...@gmail.com

unread,
Sep 20, 2021, 1:43:19 PM9/20/21
to JpGraph
This is really for the developers as a heads up on getting ready to support PHP 8.1. The following errors are being thrown trying to produce a simple graph. There are likely others to be found. The line numbers in jpgraph.php are off just slightly as I have a modification in my copy to prevent errors that happen with the PHP 8.0 stream.

PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 400                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 401                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  Function strftime() is deprecated in jpgraph.php on line 408                                        
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  imagefilledpolygon(): Using the $num_points parameter is deprecated in gd_image.inc.php on line 1440
PHP Deprecated:  Implicit conversion from float 80.5 to int loses precision in gd_image.inc.php on line 935          
PHP Deprecated:  Implicit conversion from float 139.5 to int loses precision in gd_image.inc.php on line 935         
PHP Deprecated:  Implicit conversion from float 139.5 to int loses precision in gd_image.inc.php on line 935         
PHP Deprecated:  Implicit conversion from float 139.5 to int loses precision in gd_image.inc.php on line 935         
PHP Deprecated:  Implicit conversion from float 136.5 to int loses precision in gd_image.inc.php on line 935       
 

Mikhail Oleynik

unread,
Feb 25, 2022, 11:54:45 AM2/25/22
to JpGraph
JpGraph library v4.3.5 wrapper with composer and PHP 8.1 support: https://packagist.org/packages/mitoteam/jpgraph

w1djm...@gmail.com

unread,
Feb 26, 2022, 7:08:54 AM2/26/22
to JpGraph
Thanks for the tip but that doesn't help those of us who don't use/want composer. If the JPGraph package itself has been updated the authors should make it available on the JPGraph web site for everyone.

Mikhail Oleynik

unread,
Mar 4, 2022, 11:21:22 PM3/4/22
to JpGraph
Thanks for the tip but that doesn't help those of us who don't use/want composer. If the JPGraph package itself has been updated the authors should make it available on the JPGraph web site for everyone.

There no need for composer if you don't want to use it for some reasons. You can download ZIP directly from github (https://github.com/mitoteam/jpgraph). Unpack it and use jpgraph library sources from /src/lib folder. This is untouched jpgraph sources with only php 8.1 compatibility patches applied.

w1djm...@gmail.com

unread,
Mar 5, 2022, 7:42:56 AM3/5/22
to JpGraph
Thank you, that was very helpful.

w1djm...@gmail.com

unread,
Mar 5, 2022, 9:19:52 AM3/5/22
to JpGraph
Unfortunately it doesn't appear to be as simple as dropping in the updated code. It isn't throwing the PHP errors now, which is goodness, but it is complaining about not being able to find what should be built in fonts (FF_ARIAL,FS_BOLD for example.)

w1djm...@gmail.com

unread,
Mar 5, 2022, 9:28:21 AM3/5/22
to JpGraph
For completeness attached is a snapshot of the error message.
Screenshot 2022-03-05 092704.png

Mikhail Oleynik

unread,
Mar 7, 2022, 3:43:34 AM3/7/22
to JpGraph
Could you please create an issue at github about this problem? 
Will try to find out how solve it.

Thank you.

w1djm...@gmail.com

unread,
Mar 7, 2022, 11:57:34 AM3/7/22
to JpGraph
An issue has been created as requested.
Reply all
Reply to author
Forward
0 new messages