Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何正确配置对PHP的GD支持?调用imagettfbbox()时出错_Php_Symfony_Gd_Captcha_Fosuserbundle - Fatal编程技术网

如何正确配置对PHP的GD支持?调用imagettfbbox()时出错

如何正确配置对PHP的GD支持?调用imagettfbbox()时出错,php,symfony,gd,captcha,fosuserbundle,Php,Symfony,Gd,Captcha,Fosuserbundle,为Symfony 2.0使用Symfony2.0和Gregwar验证码包 操作系统:Mac OS 10.10(约塞米蒂) 在按照说明安装了Captchable之后,我第一次使用它时,出现以下错误: 致命错误:调用未定义的函数 中的Gregwar\captchable\Generator\imagettfbbox() /Users/pgbonino/Sites/preparatest/vendor/bundles/Gregwar/captchabulable/Generator/CaptchaGe

为Symfony 2.0使用Symfony2.0和Gregwar验证码包 操作系统:Mac OS 10.10(约塞米蒂)

在按照说明安装了Captchable之后,我第一次使用它时,出现以下错误:

致命错误:调用未定义的函数 中的Gregwar\captchable\Generator\imagettfbbox() /Users/pgbonino/Sites/preparatest/vendor/bundles/Gregwar/captchabulable/Generator/CaptchaGenerator.php 在线176

我的phpinfo通知如下:

gd
启用GD支持
捆绑的GD版本(2.1.0兼容)
已启用GIF读取支持
GIF创建支持已启用
已启用JPEG支持
libJPEG版本9兼容
启用WBMP支持
已启用XBM支持
比较您的phpinfo()输出和我的输出,我发现尽管GD是活动的,但PHP安装中缺少FreeType。这个函数同时需要GD库和FreeType库

下面是我的phpinfo()的相应部分:

phpinfo开头的Configure命令块也应列出freetype:

“./配置“”--前缀=/usr/local/ceral/php55/5.5.18“”--localstatedir=/usr/local/var“”--sysconfdir=/usr/local/etc/php/5.5“”--配置文件路径=/usr/local/etc/php/5.5“”--配置文件扫描目录=/usr/local/etc/php/5.5/conf.d“”--使用iconv目录=/usr“”--启用dba“”--使用ndbm=/usr“”--启用exif“”--启用intl“”--启用soap”“--启用wddx”“--启用ftp”“--启用套接字”“--启用zip”“--启用shmop”“--启用sysvsem”“--启用sysvshm”“--启用sysvmsg”“--启用mbstring”“--启用mbregex”“--启用bcmath”“--启用日历”“--使用zlib=/usr/local/opt/zlib”“--使用ldap sasl=/usr”“--使用xmlrpc”“--使用kerberos=/usr”“--使用gd”“--启用gd native ttf””--使用freetype dir=/usr/local/opt/freetype'”--使用icu dir=/usr/local/opt/icu4c“”--使用jpeg dir=/usr/local/opt/libpng“”--使用gettext=/usr/local/opt/gettext“”--使用libedit“”--使用unixODBC=/usr/local/opt/unixODBC“”--使用pdo=unixODBC,/usr/local/opt/unixodbc'--mandir=/usr/local/cillar/php55/5.5.18/share/man'--mhash'--curl'--snmp=/usr'--with-bz2=/usr'--disable-debug'--openssl=/usr'--xsl=/usr/sbin/apxs libexedir=/usr/local local/local/libexec'--mysql sock=/ph5/5.5.18/libexec'--with-mysql sock=/tmp/usr'--“--使用mysql=mysqlnd”“--使用pdo mysql=mysqlnd”“--启用pcntl”“--启用zend信号”“--启用dtrace”“--启用opcache”

可能的解决方案

从您对我的评论中,我知道您已经使用Homebrew软件包管理器安装了PHP。因此,您可能希望尝试以下方法来解决您的问题:

brew install freetype

谢谢你的回答。很抱歉我对这一切一无所知。我想我们就快明白了。当我转到“brew安装freetype”时,我看到这样一句话:“警告:freetype-2.5.5已经安装,只是没有链接”。我想这恰恰意味着我在“Configure Command”块中没有“-with freetype”部分。现在的问题是:如何将修饰符放入块中?再次感谢。嘿。。。我还看到了一些东西:在文章的末尾,你说新的php.ini文件应该位于/usr/local/etc/php/5.5/php.ini。然而,在重启apache之后,在我的phpinfo.php文件中,我得到的是相同的php.ini指示:“Loaded Configuration file/etc/php.ini”。关于这件事有两件事:1。我是否应该将“/usr/local/etc/php/5.5/php.ini”版本复制到/etc目录?2.嗯,我不这么认为,因为我在“/usr/local/etc/php/5.5/php.ini”版本中也没有看到任何关于freetype的内容。我希望你能理解我试图解释的内容。greatI看到执行“brew安装php55”时出现了一些错误,例如“错误:
brew链接
步骤未成功完成。生成的公式未符号链接到/usr/local无法符号链接。/usr/local/Library/LinkedKegs不可写。”。现在我给了那个LinkedKegs目录写权限。我把那些出错的库链接起来。然而,我仍然没有在配置块中获得这些修改器。我在任何php.ini文件中都没有看到对freetype的引用。而imagettfbbox()函数仍然提供此调用未定义的函数:(嗨@ElPiter,很高兴你终于成功了。你不是第一个忽视安装说明最后一步的人(见其他评论)。接近马厩时,马往往会疾驰。:DAnd最后一点注意:如果并行安装PHP5.5和5.6,我想这绝对没有问题。它们位于不同的目录中,您可以通过更改Apache的httpd.conf中的LoadModule行在这两个版本之间自由切换。
brew install freetype