Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, October 29, 2019 9:41 PM
Hi,
We are using Azure App Service (Linux) and we are getting this error when we try to generate captcha:
PHP Fatal error: Call to undefined function imagefttext() in /home/site/wwwroot/lib/pkp/classes/captcha/CaptchaManager.inc.php on line 89
We found this:
https://stackoverflow.com/questions/7290958/php-fatal-error-call-to-undefined-function-imagettftext :
According to the PHP manual entry for imagettftext():
This function requires both the GD library and the » FreeType library.
You must be missing one or both of the required libraries in your PHP build.
So the question is how can we enable those two libraries in our app service so the imagettftext() can work?
Thank you for your support.
All replies (2)
Wednesday, October 30, 2019 8:17 AM
/en-us/azure/app-service/web-sites-php-configure#how-to-enable-extensions-in-the-default-php-runtime
If this doesn't work out you might need to use a custom php build with required extensions.
Rahber
@Rahber
Wednesday, October 30, 2019 12:50 PM
Hi,
If you need to reconfigure an extension such as GD, please use the following steps.
- SSH into your container and run the following
- "docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr"
- "docker-php-ext-install gd"
- cp /usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so /home/site/ext
To test, run "service apache2 reload" then go your PHP info page to see if the "freetype" is listed under GD.
If so, update the "extensions.ini" as shown in the "Adding the Extension" section. We will need to make some further modifications to avoid a conflict with the GD extension if the site were to be rebooted. In your Application Settings, add the following so that the "extensions.ini" is loaded before the ones under "/usr/local/etc/php/conf.d"
Additionally, you can perform the additional steps to move the other INI files to the "/home/site/ini" directory. In step 3, we'll rename the INI for GD so that it doesn't load the original GD extension on startup but continues to load other extensions.
- cp /usr/local/etc/php/conf.d/* /home/site/ini
- cd /home/site/ini
- mv docker-php-ext-gd.ini docker-php-ext-gd.old
Please let me know if this helps