• <bdo id='HGmSj'></bdo><ul id='HGmSj'></ul>

    <tfoot id='HGmSj'></tfoot>
  1. <i id='HGmSj'><tr id='HGmSj'><dt id='HGmSj'><q id='HGmSj'><span id='HGmSj'><b id='HGmSj'><form id='HGmSj'><ins id='HGmSj'></ins><ul id='HGmSj'></ul><sub id='HGmSj'></sub></form><legend id='HGmSj'></legend><bdo id='HGmSj'><pre id='HGmSj'><center id='HGmSj'></center></pre></bdo></b><th id='HGmSj'></th></span></q></dt></tr></i><div id='HGmSj'><tfoot id='HGmSj'></tfoot><dl id='HGmSj'><fieldset id='HGmSj'></fieldset></dl></div>

    1. <small id='HGmSj'></small><noframes id='HGmSj'>

      <legend id='HGmSj'><style id='HGmSj'><dir id='HGmSj'><q id='HGmSj'></q></dir></style></legend>

      使用 GD 和 libjpeg 支持编译 PHP

      时间:2024-04-13

      <i id='rdtWA'><tr id='rdtWA'><dt id='rdtWA'><q id='rdtWA'><span id='rdtWA'><b id='rdtWA'><form id='rdtWA'><ins id='rdtWA'></ins><ul id='rdtWA'></ul><sub id='rdtWA'></sub></form><legend id='rdtWA'></legend><bdo id='rdtWA'><pre id='rdtWA'><center id='rdtWA'></center></pre></bdo></b><th id='rdtWA'></th></span></q></dt></tr></i><div id='rdtWA'><tfoot id='rdtWA'></tfoot><dl id='rdtWA'><fieldset id='rdtWA'></fieldset></dl></div>

        <bdo id='rdtWA'></bdo><ul id='rdtWA'></ul>

      • <tfoot id='rdtWA'></tfoot>
                <tbody id='rdtWA'></tbody>

                <small id='rdtWA'></small><noframes id='rdtWA'>

              1. <legend id='rdtWA'><style id='rdtWA'><dir id='rdtWA'><q id='rdtWA'></q></dir></style></legend>
                本文介绍了使用 GD 和 libjpeg 支持编译 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我编译自己的 PHP,部分是为了了解更多关于 PHP 是如何组合在一起的,部分是因为我总是发现我需要默认情况下不可用的模块,而通过这种方式我可以控制它.

                I compile my own PHP, partly to learn more about how PHP is put together, and partly because I'm always finding I need modules that aren't available by default, and this way I have control over that.

                我的问题是我无法在 PHP 中获得 JPEG 支持.使用 CentOS 5.6.这是我在编译 PHP 5.3.8 时的配置选项:

                My problem is that I can't get JPEG support in PHP. Using CentOS 5.6. Here are my configuration options when compiling PHP 5.3.8:

                 './configure'  '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '--with-xsl' '--enable-zip' '--disable-fileinfo' '--with-jpeg-dir=/usr/lib/'
                

                ./configure 输出显示:

                checking for GD support... yes
                checking for the location of libjpeg... no
                checking for the location of libpng... no
                checking for the location of libXpm... no
                

                然后我们可以看到 GD 已安装,但不存在 JPEG 支持:

                And then we can see that GD is installed, but that JPEG support isn't there:

                # php -r 'print_r(gd_info());'
                Array
                (
                    [GD Version] => bundled (2.0.34 compatible)
                    [FreeType Support] =>
                    [T1Lib Support] =>
                    [GIF Read Support] => 1
                    [GIF Create Support] => 1
                    [JPEG Support] =>
                    [PNG Support] => 1
                    [WBMP Support] => 1
                    [XPM Support] =>
                    [XBM Support] => 1
                    [JIS-mapped Japanese Font Support] =>
                )
                

                我知道 PHP 需要能够找到 libjpeg,但它显然无法找到它满意的版本.我会认为 /usr/lib/libjpeg.so/usr/lib/libjpeg.so.62 会是它需要的,但我提供了正确的lib 目录 (--with-jpeg-dir=/usr/lib/) 并且它没有拾取它们,所以我猜它们不可能是正确的版本.

                I know that PHP needs to be able to find libjpeg, and it obviously can't find a version it's happy with. I would have thought /usr/lib/libjpeg.so or /usr/lib/libjpeg.so.62 would be what it needs, but I supplied it with the correct lib directory (--with-jpeg-dir=/usr/lib/) and it doesn't pick them up so I guess they can't be the right versions.

                rpm 表示已安装 libjpeg.我应该 yum remove 并重新安装它,以及它的所有依赖包吗?这能解决问题吗?

                rpm says libjpeg is installed. Should I yum remove and reinstall it, and all it's dependent packages? Might that fix the problem?

                这是一个粘贴箱,其中收集了一些有用的系统信息:
                http://pastebin.com/ied0kPR6

                Here's a paste bin with a collection of hopefully useful system information:
                http://pastebin.com/ied0kPR6

                对于与服务器故障交叉发布的道歉(https://serverfault.com/q/304310/92291)尽管我试图了解 Stack Exchange 在交叉发布方面的立场,但并不清楚:https://meta.stackexchange.com/q/75326/167958

                Apologies for cross-posting with Server Fault ( https://serverfault.com/q/304310/92291 ) although I tried to discover what Stack Exchange's position on cross-posting was and it wasn't clear: https://meta.stackexchange.com/q/75326/167958

                推荐答案

                按要求:

                有时配置脚本很笨,你必须使用--with-somelib=/usr 而不是...=/usr/lib,因为配置测试写成providedpath + '/lib/' 而不是只是在内部提供了路径.您可能需要在配置测试套件中四处挖掘才能找出真正需要的内容

                Sometimes the configure script is dumb, and you have to do --with-somelib=/usr instead of ...=/usr/lib, because the config test is written as providedpath + '/lib/' rather than just providedpath internally. You may have to dig around inside the configure test suite to find out what's really required

                这篇关于使用 GD 和 libjpeg 支持编译 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:php-fpm 不创建 .sock 文件 下一篇:PHP 会话未保存在内存缓存中

                相关文章

                1. <small id='KfWfP'></small><noframes id='KfWfP'>

                    <bdo id='KfWfP'></bdo><ul id='KfWfP'></ul>
                2. <legend id='KfWfP'><style id='KfWfP'><dir id='KfWfP'><q id='KfWfP'></q></dir></style></legend>
                  <tfoot id='KfWfP'></tfoot>
                  <i id='KfWfP'><tr id='KfWfP'><dt id='KfWfP'><q id='KfWfP'><span id='KfWfP'><b id='KfWfP'><form id='KfWfP'><ins id='KfWfP'></ins><ul id='KfWfP'></ul><sub id='KfWfP'></sub></form><legend id='KfWfP'></legend><bdo id='KfWfP'><pre id='KfWfP'><center id='KfWfP'></center></pre></bdo></b><th id='KfWfP'></th></span></q></dt></tr></i><div id='KfWfP'><tfoot id='KfWfP'></tfoot><dl id='KfWfP'><fieldset id='KfWfP'></fieldset></dl></div>