DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

tips:phpwithgd

PHP and gdlib

Some plugins might use functions like ImageCreate or ImagePng or others to create PNG or JPEG images dynamically. In this case PHP must have been installed on your machine/webserver with gdlib support. Otherwise nothing will happen except no images are created. This means even so the required lib is not installed you might not see any warning or error messages.

Checking for gdlib support

If you install a file including the code

<?php phpinfo(); ?>

on your webserver and open the URL to the file in a browser, then information about the installed PHP version will appear. There should be a section with the heading GD. Otherwise gdlib is not installed.

You can also use the following code to have a simple and clear indication:

<?php
if (extension_loaded('gd') && function_exists('gd_info')) {
    echo "PHP GD library is installed on your web server";
}
else {
    echo "PHP GD library is NOT installed on your web server";
}
?>

If there is no gdlib installed, then you need to install it to make plugins work which require it.

Installing gdlib support for PHP

Please find installation instructions here. Please remember that a restart of the webserver might be required after installing gdlib support to make the change take affect.

Ubuntu

On Ubuntu just run

sudo apt-get install php5-gd

On CentOS just run

sudo yum install php-gd

FIXME Provide installation instructions for other OS

Plugins requiring gdlib

The following plugins are known to require gdlib:

tips/phpwithgd.txt · Last modified: 2016-08-28 13:55 by LarsDW223