Author Topic: New issue after upgrading to php 7.2  (Read 3333 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
New issue after upgrading to php 7.2
« on: December 03, 2017, 01:23:03 PM »
I have a small script that will call temperatures from a pre-defined location on my server and then place these temperatures on a map.  All was working by design until I try to run the script using php 7.2.  Php 7.2 throws errors and the map is now blank.  Using php 7.1.x did not exhibit this problem.   The errors in my server logs is:

[Sun Dec 03 11:30:45.537850 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 130
[Sun Dec 03 11:30:45.537850 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 141
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 152
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 163
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 174
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 185
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 196
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 207
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 218
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 230
[Sun Dec 03 11:30:45.538851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 241
[Sun Dec 03 11:30:45.539851 2017] [php7:warn] [pid 5368:tid 856] [client ::1:53612] PHP Warning:  imagettftext(): Could not find/open font in C:\\www\\temp_map.php on line 252


Attached is a copy of the script and one of the populated map.  I could use a little help  ](*,)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New issue after upgrading to php 7.2
« Reply #1 on: December 03, 2017, 03:54:44 PM »
All those errors are due to line 17

$font       = 'arial.ttf';         // font file

The file 'arial.ttf' is not in the same directory as temp_map.php
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: New issue after upgrading to php 7.2
« Reply #2 on: December 03, 2017, 06:13:44 PM »
But it is.  Both files reside in the root directory of the server.  If I back down to php 7.1.9 it begins to work again with no other changes.   ](*,) ](*,)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New issue after upgrading to php 7.2
« Reply #3 on: December 03, 2017, 07:15:35 PM »
It's in the C:\www\ directory as 'arial.ttf' (not arial.TTF or Arial.ttf)?   Is your site using IIS?  If so, it may be a permissions thing w/7.2 and IIS not letting fonts load.   I'm using 7.1 with XAMPP and no issues.. haven't tried 7.2 quite yet.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: New issue after upgrading to php 7.2
« Reply #4 on: December 03, 2017, 07:22:54 PM »
Yes, it is all lower case, just as it is in the script.  My site runs on Apache/2.4.29 (Win32) OpenSSL/1.0.2m and PHP/7.1.9 for now.  I can't seem to get through this roadblock introduced in php 7.2.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: New issue after upgrading to php 7.2
« Reply #5 on: December 03, 2017, 07:33:43 PM »
UPDATE:  I thought I had tried using an absolute path before but perhaps not because I just changed it to 'C:\www\arial.ttf' and it seems to work!  I will play a bit before I go live with 7.2 in case there are any other surprises.  Thanks for the help Ken.