php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #26147 PHP Fatal error: Call to undefined function: imagepsloadfont() in /XXX/X.php
Submitted: 2003-11-05 23:39 UTC Modified: 2003-11-07 07:45 UTC
From: rwh at lim dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.4 OS: RH9
Private report: No CVE-ID: None
 [2003-11-05 23:39 UTC] rwh at lim dot com
Description:
------------
PHP is compiled as an Apache 1.3 DSO; 
./configure --with-apxs=/path/to/apxs 
            --with-gd 
            --with-zlib-dir=/path/to/dir

I just upgraded the PHP engine from 3.0.x to 4.3.4 and I'm debugging the php3 code.  According to http://php.net/imagepsloadfont, imagepsloadfont() is a built-in function, so I don't understand the Fatal Error.

Here is the line from my apache log:
[Wed Nov  5 18:33:04 2003] [error] PHP Fatal error:  Call to undefined function:  imagepsloadfont() in /path/to/chart.inc on line 322

Reproduce code:
---------------
Here is line 322 of chart.inc:
--------------------------------------
313 function render ($log = false, $cache = false)
    {
      if(!$this->is_chart)
        return false;
      $this->rescale();

      if ($log)
        $this->log = $log;

322   $fgc  = imagepsloadfont(_fontpath . "/type1/FGC_____.pfb");

      $im = imagecreate($this->x, $this->y);
      $bgcolor    = ImageColorAllocate($im, 255, 255, 255);
      $fgcolor[0] = ImageColorAllocate($im, 0, 0, 0);
      $fgcolor[1] = ImageColorAllocate($im, 0, 0, 255);
      $hicolor    = ImageColorAllocate($im, 255, 0, 0);
      $bdcolor    = ImageColorAllocate($im, 229, 227, 204);
330   $gridcolor  = ImageColorAllocate($im, 192, 192, 192);
---------------------------------

Also:

---------------------------------
15    define('_fontpath', '/path/to/fonts');
---------------------------------


Expected result:
----------------
I expect the code to make it through the engine without a Fatal Error.  The function is a built-in so I don't see how it would be undefined.

Actual result:
--------------
Here is the line from my apache log:
[Wed Nov  5 18:33:04 2003] [error] PHP Fatal error:  Call to undefined function:  imagepsloadfont() in /path/to/chart.inc on line 322

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-06 14:52 UTC] sniper@php.net
You need to compile PHP with --with-t1lib option.
Manual pages for these functions should mention this better.

 [2003-11-07 07:45 UTC] didou@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 15:01:28 2024 UTC