|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-20 15:20 UTC] akger1379 at gmail dot com
[2018-04-04 13:30 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2018-04-04 13:30 UTC] cmb@php.net
[2018-06-24 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ Trying to open a .ttf file in a CIFS mounted share (644 file permissions) causes PHP Warning: imagefttext(): Could not read font in /var/www/whatever/whatever/morewhatever/whatever/whatever/test.php on line 23 I tried to create the attached script (which sets GDFONTPATH to the current dir) to have a test. When run from /tmp with all the font files in the same directory, it works. But when I moved into a CIFS mounted webroot, it stops working. It also fails when executing from the command line, from apache, as root, etc. Test script: --------------- <?php $cwd = getcwd(); putenv("GDFONTPATH=$cwd"); // Note: You can find DejaVuSans.ttf on /usr/share/fonts/truetype/ttf-dejavu/ // if you "apt-get install ttf-dejavu" $font1 = 'DejaVuSans.ttf'; $image = imagecreate( 400, 400 ); $bgcolor = imagecolorallocate($image, 255, 0, 0); $color = imagecolorallocate($image, 255, 255, 0); imagefttext( $image, 10, 0, 100, 100, $color, $font1, 'Test1'); header("Content-Type: image/png"); imagepng($image); imagedestroy($image); ?> Expected result: ---------------- Both on a cifs mounted drive and a normal path you should get the PNG image with the "Test1" string. Actual result: -------------- # php test.php PHP Warning: imagefttext(): Could not find/open font in /var/www/phemiumconsultant/portals/consultant/runtime3g/layouts/fonts/test.php on line 12 ...PNG... binary data...