dpecb06062 2018-05-08 18:59
浏览 110

PHP警告:include_once()

I need help with these few errors here

`[06-May-2018 20:08:16 America/New_York] PHP Warning: include_once(unifont/ttfonts.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 507

[06-May-2018 20:08:16 America/New_York] PHP Warning: include_once(): Failed opening 'unifont/ttfonts.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.45/lib/php') in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 507

[06-May-2018 20:08:16 America/New_York] PHP Fatal error: Class 'TTFontFile' not found in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 508`

This is the line 507:

    if (!isset($type) ||  $type != "TrueTypesubset") {
        include_once($this->_getfontpath().'unifont/ttfonts.php');

line 507>>> $ttf = new TTFontFile();

And this is line 508

            $ttf = new TTFontFile();

I updated the paths to this :

    if ($uni) {
    if (defined("_SYSTEM_TTFONTS") && file_exists(_SYSTEM_TTFONTS.$file )) { $ttfilename = _SYSTEM_TTFONTS.$file ; }
    else { $ttfilename = $this->_getfontpath().'/Applications/MAMP/htdocs/squid/lib/font/unifont/'.$file ; }
    $filename = $file;
    $filename =str_replace(' ','',$filename );
    $filename =str_replace('-','',$filename );
    $unifilename = $this->_getfontpath().'unifont/'.strtolower(substr($filename ,0,(strpos($filename ,'.'))));
    $diff = '';
    $enc = '';
    if (file_exists($unifilename.'.mtx.php')) {
        include($unifilename.'.mtx.php');
    }
    if (!isset($type) ||  $type != "TrueTypesubset") {
        include_once($this->_getfontpath().'/Applications/MAMP/htdocs/squid/lib/font/');
        $ttf = new TTFontFile();

This is the font folder:

squid\lib\tfpdf\font full path: /Applications/MAMP/htdocs/squid/lib/font/

This is the unifont folder

squid\lib\tfpdf\font\unifont Full path: /Applications/MAMP/htdocs/squid/lib/font/unifont

When i change the paths i get this error:

[08-May-2018 14:38:02 America/New_York] PHP Warning:  include_once(/Applications/MAMP/htdocs/squid/lib/font/): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 507

[08-May-2018 14:38:02 America/New_York] PHP Warning: include_once(): Failed opening '/Applications/MAMP/htdocs/squid/lib/font/' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.45/lib/php') in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 507 [08-May-2018 14:38:02 America/New_York] PHP Fatal error: Class 'TTFontFile' not found in /Applications/MAMP/htdocs/squid/lib/tfpdf.php on line 508

  • 写回答

3条回答 默认 最新

  • drr7731 2018-05-08 19:10
    关注

    Try changing

    /Applications/MAMP/htdocs/squid/lib/font/

    to

    /squid/lib/font/

    does that help?

    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)