jpgraph 警告 (2):file_exists() [function.file-exists]:open_basedir 限制生效

jpgraph Warning (2): file_exists() [function.file-exists]: open_basedir restriction in effect

我在使 jpgraph 图像在网络上工作时遇到了问题。当我 运行 它在本地主机中时,jpgraphs 工作但是当我上传它时有一条错误消息:

Warning (2): file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/share/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) [APP/Vendor/jpgraph/jpgraph-3.5.0b1/src/jpgraph_ttf.inc.php, line 505]

还有这个

Warning (2): file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/share/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) [APP/Vendor/jpgraph/jpgraph-3.5.0b1/src/jpgraph_ttf.inc.php, line 510]

如果你们有任何需要澄清的问题,请随时提出。提前谢谢你

这实际上是您的 PHP 配置问题,而不是 CakePHP。

来自http://php.net/manual/en/ini.core.php

Limit the files that can be accessed by PHP to the specified directory-tree

打开您的 php.ini,查找 open_basedir 行,然后将其注释掉。

重新启动网络服务器,您就可以开始了。