This question has been asked over and over but I could not find the correct answer to my problem... As a little background note, all the code was working perfectly before we moved the class file from /application/lib/class to /library/class ...
I have tried to play with GDFONTPATH, relative, absolute paths with and without the file extension to no avail. Here is some of the lines we have tried so far:
putenv('GDFONTPATH=' . realpath(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'fonts'));
/*1*/ $FontName = dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.basename($FontName,'.ttf');
/*2*/ $FontName = 'pChartfonts\'.basename($FontName);
/*3*/ $FontName =basename($FontName);
$coords = imagettfbbox($FontSize, 0, $FontName, $Text);
Multiple combination of those tries have also been used to no avail. I am really annoyed by this problem as the #1, when echo'ed gives a full path that opens up the correct font file if copy/pasted in win explorer.
It might help to know the absolute path of the file getting the error and the path of the fontname...
C:wampwwwapplication_bundleLibrarypChartclasspImage.class.php
C:wampwwwapplication_bundleLibrarypChartfontsarialuni.ttf
We are experiencing this problem on all dev platforms (Win, Mac and Linux) PHP 5.3.13
Thank you for your assistance.
Edit: It seems as if the file is not found / the server is not looking at the right folder... If someone could help troubleshoot the problem by pointing out how to figure out what path GD is trying to open would really help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…