Ressources documentaires pour Mandriva Linux et les Logiciels Libres

Installing PHP cairo wrapper under Mandriva 2009.0

For the intranet of my society, I’m using eZ Components to create the graph. I used to create the graph in SVG, convert them to PNG with rsvg and imagemagick and then insert into a PDF generated by FPDF. However i was willing now to output the graph directly to the browser for a web stats page. By default eZGraph will output in SVG. Whereas this is not an issue with Firefox 3, users with Internet explorer or Firefox 2 may have issue displaying SVG files ( plugin needed ). Trying the GD driver instead lead me to the impossibility to create a graph because it was not able to find my font file …

In the end, I decide to try the Cairo driver. However you need the PHP cairo_wrapper which is not available in Mandriva. So here is how you can install PHP cairo_wrapper from pear channels under Mandriva. We are supposing that you have a working PHP configuration :

  1. Install pear, php-devel and cairo devel packages : urpmi php-pear php-devel libcairo-devel
  2. Add the channel : pear channel-discover
  3. Set PEAR default state to beta because this package is in beta state : pear config-set preferred_state beta
  4. Install cairo_wrapper from thsi channel : pear install php-baustelle/cairo_wrapper
  5. Make PHP load the extension : echo « » > /etc/php.d/33_cairo_wrapper.ini
  6. Restart Apache : service httpd restart
  7. For safety purposes, set back PEAR preferred_state to stable : pear config-set preferred_state stable

Note : The PHP cairo wrapper is a C extension which need to be compiled, so you need gcc and glibc-devel too.


Aucun commentaire jusqu'à présent.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *


My Tweets