admin/environment/php extension/gd: Difference between revisions
m (added link to spanish translation of page) |
m (Fix typo in == GD extension for PHP ==) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Environment}} | {{Environment}} | ||
== GD | == GD extension for PHP == | ||
This | This extension provides functionality for handling graphics directly from PHP scripts. It supports the PNG, JPEG, XPM formats as well as FreeType/ttf fonts. | ||
== | == Installing == | ||
Package names below may vary if using third party package repositories or the PHP version is different from the operating system's default. | |||
=== Ubuntu === | |||
Download and install gd | Download and install gd: | ||
sudo apt-get install | sudo apt-get install php-gd | ||
You might need to restart Apache (not necessary) | You might need to restart Apache (not necessary): | ||
sudo /etc/init.d/apache2 restart | sudo /etc/init.d/apache2 restart | ||
=== CentOS === | |||
Download and install gd | Download and install gd: | ||
dnf install php-gd | |||
You might need to restart | You might need to restart PHP-FPM to apply the change in configuration: | ||
systemctl restart php-fpm | |||
If you are unable to find the correct package try searching with: | |||
dnf search 'php*-gd' | |||
=== Microsoft Windows === | |||
The gd extension is normally included in the ''ext'' folder with PHP for Microsoft Windows. If Moodle reports this is missing ensure the following line is in ''php.ini'': | |||
extension=gd | |||
There must be no ';' at the start of this line. | |||
You will probably need to restart your web server to apply this change: for XAMPP run ''xampp_stop'' then ''xampp_start''. | |||
[[Category:Environment|PHP]] | [[Category:Environment|PHP]] | ||
[[es:admin/environment/php extension/gd]] | [[es:admin/environment/php extension/gd]] |
Latest revision as of 22:36, 29 December 2022
GD extension for PHP
This extension provides functionality for handling graphics directly from PHP scripts. It supports the PNG, JPEG, XPM formats as well as FreeType/ttf fonts.
Installing
Package names below may vary if using third party package repositories or the PHP version is different from the operating system's default.
Ubuntu
Download and install gd:
sudo apt-get install php-gd
You might need to restart Apache (not necessary):
sudo /etc/init.d/apache2 restart
CentOS
Download and install gd:
dnf install php-gd
You might need to restart PHP-FPM to apply the change in configuration:
systemctl restart php-fpm
If you are unable to find the correct package try searching with:
dnf search 'php*-gd'
Microsoft Windows
The gd extension is normally included in the ext folder with PHP for Microsoft Windows. If Moodle reports this is missing ensure the following line is in php.ini:
extension=gd
There must be no ';' at the start of this line.
You will probably need to restart your web server to apply this change: for XAMPP run xampp_stop then xampp_start.