gpt4 book ai didi

php - 使用 pecl 在 apd 安装中运行 phpize 时出现 "Cannot find config.m4."

转载 作者:行者123 更新时间:2023-12-03 00:01:43 27 4
gpt4 key购买 nike

我正在尝试访问 PHP 中的 rename_function,为此我需要 PECL APD。我运行的是 Ubuntu 14.04 LTS。

我正在尝试运行sudo pecl install apd,但我得到:

downloading apd-1.0.1.tgz ...Starting to download apd-1.0.1.tgz (36,643 bytes)..........done: 36,643 bytes15 source files, buildingrunning: phpizeCannot find config.m4.Make sure that you run '/usr/bin/phpize' in the top level source directory ofthe moduleIf the command failed with 'phpize: not found' then you need to install php5-dev package. You can do it by running 'apt-get install php5-dev' as a root userERROR: `phpize' failed

我应该从某个目录运行此命令吗?

这次我在打开详细选项的情况下进行了尝试,以防日志中出现线索:

sudo /usr/bin/pecl -vvvvv install apd
Warning: file_exists(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1518Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1528Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1528Downloading "http://pecl.php.net/get/apd-1.0.1.tgz"downloading apd-1.0.1.tgz ...Starting to download apd-1.0.1.tgz (36,643 bytes)..........done: 36,643 bytes+ cp /tmp/pear/temp/tmpNUpEpz/apd-1.0.1/LICENSE /usr/share/php/doc/apd/.tmpLICENSEadding to transaction: chmod 664 /usr/share/php/doc/apd/.tmpLICENSEadding to transaction: rename /usr/share/php/doc/apd/.tmpLICENSE /usr/share/php/doc/apd/LICENSEadding to transaction: installed_as LICENSE /usr/share/php/doc/apd/LICENSE /usr/share/php/doc /apd+ cp /tmp/pear/temp/tmpNUpEpz/apd-1.0.1/README /usr/share/php/doc/apd/.tmpREADMEadding to transaction: chmod 664 /usr/share/php/doc/apd/.tmpREADMEadding to transaction: rename /usr/share/php/doc/apd/.tmpREADME /usr/share/php/doc/apd/READMEadding to transaction: installed_as README /usr/share/php/doc/apd/README /usr/share/php/doc /apd+ cp /tmp/pear/temp/tmpNUpEpz/apd-1.0.1/pprofp /usr/bin/.tmppprofp+ chmod +x /usr/bin/.tmppprofpadding to transaction: chmod 775 /usr/bin/.tmppprofpadding to transaction: rename /usr/bin/.tmppprofp /usr/bin/pprofpadding to transaction: installed_as pprofp /usr/bin/pprofp /usr/bin /+ cp /tmp/pear/temp/tmpNUpEpz/apd-1.0.1/pprof2calltree /usr/bin/.tmppprof2calltree+ chmod +x /usr/bin/.tmppprof2calltreeadding to transaction: chmod 775 /usr/bin/.tmppprof2calltreeadding to transaction: rename /usr/bin/.tmppprof2calltree /usr/bin/pprof2calltreeadding to transaction: installed_as pprof2calltree /usr/bin/pprof2calltree /usr/bin /15 source files, buildingbuilding in /tmp/pear/temp/pearf7LGcarunning: phpizeCannot find config.m4.Make sure that you run '/usr/bin/phpize' in the top level source directory of the moduleIf the command failed with 'phpize: not found' then you need to install php5-dev packageYou can do it by running 'apt-get install php5-dev' as a root userrolling back 12 file operations+ rm /usr/share/php/doc/apd/.tmpLICENSE+ rm /usr/share/php/doc/apd/.tmpREADME+ rm /usr/bin/.tmppprofp+ rm /usr/bin/.tmppprof2calltreeERROR: `phpize' failedWarning: unlink(/tmp/glibctestRdKE0K): No such file or directory in System.php on line 214Warning: unlink(/tmp/pear/temp/pearf7LGca): No such file or directory in System.php on line 214

最佳答案

这将是运行 APD 作为 PHP 分析器的先决条件的所有内容的简短摘要,我希望它能帮助您的需求。此摘要适用于 PHP 5.6.2 APD 1.0.1,对于其他版本可能不正确。

首先,如果您不能确保这两项,请不要启动它:

  • 停用 Zend 平台或任何其他 PHP 优化器。一般来说,您需要禁用所有 Zend 扩展。
  • 安装支持调试的 PHP 版本 ( --enable-debug )

如果您有有效的 PEAR 设置,则需要像 this 中那样设置 APD。文章。也不要忘记尝试分发包。否则 APD 的构建如下:

  • 提取 tarball。
  • 更改 tarball 中的目录。
  • 运行<apache root>/bin/phpsize
  • 运行./configure (如果配置失败,请添加 --with-php-config=<apache root>/bin/php-config。)
  • 使用以下命令编译并安装所有内容
    makemake install
  • Edit php.ini and add at least
    zend_extension=/apd.soapd.statement=1apd.tracedir=/tmp/apd-traces
  • Create the output directory specified in php.ini

Now you'll need to restart Apache but before you do, check that the APD extension works fine. To do simply run PHP

/bin/php

No warning should be given if extension is loaded properly. If you get error message something like the "apd.so" extension couldn't be loaded there is a problem. Check if you compiled against the correct Apache/PHP version and using the same right now.

If PHP doesn't complain about anything enter:

<?php phpinfo(); ?>

并检查一些有关 APD 的行。如果你找到它们,你就完成了。

您还需要一些跟踪,因此要开始跟踪,您需要 Apache 允许 PHP 模块加载 APD。接下来,您需要识别要跟踪的脚本。在脚本顶部添加 APD 调用:

apd_set_pprof_trace();

然后提出一些要求并再次删除该声明,以避免造成进一步的伤害。现在看一下跟踪目录。您应该找到命名方案为 pprof[0-9]*.[0-9] 的文件。这里。使用 pprofp 解码它们来自 APD 源 tarball 的工具。示例:

/bin/php /pprofp -u 

如有必要,重定向标准输出。使用 -t 而不是 -u (摘要输出)来获取调用树。当您使用 -t 创建跟踪时,您也会获得摘要输出,但它不包含每次调用的持续时间。我建议始终创建调用树和摘要跟踪。

希望有所帮助,我建议您几乎阅读上面提到的链接

编辑:

phpize 命令旨在在扩展源目录的顶层运行(此源目录应包含文件名 config.m4)。请参阅this了解更多信息。

关于php - 使用 pecl 在 apd 安装中运行 phpize 时出现 "Cannot find config.m4.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24612979/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com