{"id":97,"date":"2020-09-20T06:31:17","date_gmt":"2020-09-20T06:31:17","guid":{"rendered":"https:\/\/focalx.com\/blog\/?p=97"},"modified":"2021-04-28T21:50:20","modified_gmt":"2021-04-28T21:50:20","slug":"php-7-3-php-gd-failed-to-load-undefined-symbol-hb_ft_font_set_load_flags","status":"publish","type":"post","link":"https:\/\/focalx.com\/blog\/2020\/09\/php-7-3-php-gd-failed-to-load-undefined-symbol-hb_ft_font_set_load_flags\/","title":{"rendered":"PHP 7.3 php-gd failed to load ( undefined symbol: hb_ft_font_set_load_flags)"},"content":{"rendered":"\n<p>If you recently upgraded your CentOS 7 PHP to version 7.3 (or probably 7.2) using remi repository, you might encounter an error complaining php-gd dynamic library failed to load when running any php command. You system may miss to upgrade an package which is used by php-gd library. It is an easy fix by install or upgrade the missing package.<\/p>\n\n\n\n<h2>Problem<\/h2>\n\n\n\n<p>Your have a system using CentOS 7 and the base repository comes with only PHP 5.4, which has been deprecated for a long time. You have just tried to upgrade it to a more recent PHP version 7.2 or later. One of most common way is using yum remi&#8217;s RPM repository. However, after the upgrade, the system returns this error for any PHP command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PHP Warning: PHP Startup: Unable to load dynamic library 'gd' (tried: \/usr\/lib64\/php\/modules\/gd (\/usr\/lib64\/php\/modules\/gd: cannot open shared object file: No such file or directory), \/usr\/lib64\/php\/modules\/gd.so (\/lib64\/libraqm.so.0: undefined symbol: hb_ft_font_set_load_flags)) in Unknown on line 0<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"822\" height=\"183\" src=\"https:\/\/focalx.com\/blog\/wp-content\/uploads\/2020\/09\/image.png\" alt=\"\" class=\"wp-image-98\" srcset=\"https:\/\/focalx.com\/blog\/wp-content\/uploads\/2020\/09\/image.png 822w, https:\/\/focalx.com\/blog\/wp-content\/uploads\/2020\/09\/image-300x67.png 300w, https:\/\/focalx.com\/blog\/wp-content\/uploads\/2020\/09\/image-768x171.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/figure>\n\n\n\n<p>Note that the error mentioned<code> \"underfined symbol: hb_ft_font_set_load_flags\"<\/code>. This symbol is coming from an package called HarfBuzz (<a href=\"https:\/\/harfbuzz.github.io\/harfbuzz-hb-ft.html\">https:\/\/harfbuzz.github.io\/harfbuzz-hb-ft.html<\/a>). <em>HarfBuzz<\/em> is a package providing face and font data support using <em>FreeType<\/em>, while php-gd is using. Your system most likely should have this package installed already but you might not have been keeping this package up to date. PHP 7.3 php-gd requires latest <em>HarfBuzz<\/em> which provides the missing symbol &#8220;hb_ft_font_set_load_flags&#8221;.<\/p>\n\n\n\n<h2>Solution<\/h2>\n\n\n\n<p>The simplest solution is to install or upgrade the HarfBuzz package to the latest version by using <em>yum<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum install harfbuzz<\/pre>\n\n\n\n<p>After <em>HarfBuzz<\/em> upgraded to the latest version, the above PHP error should be gone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you recently upgraded your CentOS 7 PHP to version 7.3 (or probably 7.2) using remi repository, you might encounter an error complaining php-gd dynamic library failed to load when running any php command. You system may miss to upgrade an package which is used by php-gd library. It is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":100,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[17,16],"_links":{"self":[{"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":2,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/posts\/97\/revisions\/101"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/media\/100"}],"wp:attachment":[{"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/focalx.com\/blog\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}