我正在尝试使用rename_functionPHP 访问,为此我需要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 bytes 15 source files, building running: phpize Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module If 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 1518 Warning: 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 1528 Warning: 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 1528 Downloading "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/.tmpLICENSE adding to transaction: chmod 664 /usr/share/php/doc/apd/.tmpLICENSE adding to transaction: rename /usr/share/php/doc/apd/.tmpLICENSE /usr/share/php/doc/apd/LICENSE adding 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/.tmpREADME adding to transaction: chmod 664 /usr/share/php/doc/apd/.tmpREADME adding to transaction: rename /usr/share/php/doc/apd/.tmpREADME /usr/share/php/doc/apd/README adding 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/.tmppprofp adding to transaction: chmod 775 /usr/bin/.tmppprofp adding to transaction: rename /usr/bin/.tmppprofp /usr/bin/pprofp adding 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/.tmppprof2calltree adding to transaction: chmod 775 /usr/bin/.tmppprof2calltree adding to transaction: rename /usr/bin/.tmppprof2calltree /usr/bin/pprof2calltree adding to transaction: installed_as pprof2calltree /usr/bin/pprof2calltree /usr/bin / 15 source files, building building in /tmp/pear/temp/pearf7LGca running: phpize Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module If 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/.tmppprof2calltree ERROR: `phpize' failed Warning: unlink(/tmp/glibctestRdKE0K): No such file or directory in System.php on line 214 Warning: unlink(/tmp/pear/temp/pearf7LGca): No such file or directory in System.php on line 214
bal*_*ker 17
这将是将APD作为PHP分析器运行的前提条件的简短摘要,我希望它能帮助您满足需求.此摘要适用于PHP 5.6.2 APD 1.0.1,对于其他版本可能不正确.
首先,如果你不确定这两个,就不要启动它:
--enable-debug)版本如果你有一个工作PEAR安装你需要设置APD像这样的文章.不要忘记尝试分发包.否则APD的构建如下:
<apache root>/bin/phpsize./configure(--with-php-config=<apache root>/bin/php-config如果配置失败,则添加.)make make install
zend_extension=/apd.so apd.statement=1 apd.tracedir=/tmp/apd-traces
现在您需要重新启动Apache,但在此之前,请检查APD扩展是否正常工作.简单地运行PHP
/bin/php
如果正确加载扩展名,则不应发出警告.如果您收到错误消息,例如无法加载"apd.so"扩展名,则会出现问题.检查您是否针对正确的Apache/PHP版本编译并立即使用相同的版本.
如果PHP没有抱怨任何输入:
<?php phpinfo(); ?>
Run Code Online (Sandbox Code Playgroud)
并检查一些关于APD的信息.如果你发现它们就完成了.
您还需要一些跟踪,以便开始跟踪您需要Apache以允许PHP模块加载APD.接下来,您需要确定要跟踪的脚本.在脚本顶部添加APD调用:
apd_set_pprof_trace();
Run Code Online (Sandbox Code Playgroud)
然后提出一些请求并再次删除该语句以避免造成进一步的伤害.现在看一下trace目录.您应该找到具有pprof[0-9]*.[0-9]此处命名方案的文件.使用pprofpAPD源tarball中的工具解码它们.例:
/bin/php /pprofp -u
必要时重定向标准输出.使用-t而不是-u(摘要输出)来获取调用树.使用-t创建跟踪时,也会获得摘要输出,但不包含每次调用的持续时间.我建议始终创建一个调用树和一个摘要跟踪.
希望有所帮助,我建议你几乎不要阅读上面提到的链接.
phpize命令意味着在扩展源dir的顶层运行(此源目录应包含文件名config.m4).有关详细信息,请参阅此
| 归档时间: |
|
| 查看次数: |
19361 次 |
| 最近记录: |