编译 PHP APC 时出现问题

编译 PHP APC 时出现问题

我已经下载了APC-3.1_9.tgz官方版本。

当我按照以下步骤操作时:

  1. tar -xzvf APC-3.1_9.tgz
  2. 光盘 APC-3.1_9
  3. phpize
  4. ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php (命令“哪个 php“输出/usr/bin/php
  5. 制作

我收到以下错误:

/bin/bash /tmp/APC-3.1.9/libtool --mode=compile cc  -I. -I/tmp/APC-3.1.9 -DPHP_ATOM_INC -I/tmp/APC-3.1.9/include -I/tmp/APC-3.1.9/main -I/tmp/APC-3.1.9 Usage: php [options] [-f] <file> [--] [args...] php [options] -r <code> [--] [args...] php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...] php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...] php [options] -- [args...] php [options] -a -a Run as interactive shell -c <path>|<file> Look for php.ini file in this directory -n No php.ini file will be used -d foo[=bar] Define INI entry foo with value 'bar' -e Generate extended information for debugger/profiler -f <file> Parse and execute <file>. -h This help -i PHP information -l Syntax check only (lint) -m Show compiled in modules -r <code> Run PHP <code> without using script tags <?..?> -B <begin_code> Run PHP <begin_code> before processing input lines -R <code> Run PHP <code> for every input line -F <file> Parse and execute <file> for every input line -E <end_code> Run PHP <end_code> after processing all input lines -H Hide any passed arguments from external tools. -s Output HTML syntax highlighted source. -v Version number -w Output source with stripped comments and whitespace. -z <file> Load Zend extension <file>. args... Arguments passed to script. Use -- args when first argument starts with - or script is read from stdin --ini Show configuration file names --rf <name> Show information about function <name>. --rc <name> Show information about class <name>. --re <name> Show information about extension <name>. --ri <name> Show configuration for extension <name>.  -DHAVE_CONFIG_H  -g -O2   -c /tmp/APC-3.1.9/apc.c -o apc.lo
/bin/bash: -c: line 0: syntax error near unexpected token `<'
/bin/bash: -c: line 0: `/bin/bash /tmp/APC-3.1.9/libtool --mode=compile cc  -I. -I/tmp/APC-3.1.9 -DPHP_ATOM_INC -I/tmp/APC-3.1.9/include -I/tmp/APC-3.1.9/main -I/tmp/APC-3.1.9 Usage: php [options] [-f] <file> [--] [args...] php [options] -r <code> [--] [args...] php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...] php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...] php [options] -- [args...] php [options] -a -a Run as interactive shell -c <path>|<file> Look for php.ini file in this directory -n No php.ini file will be used -d foo[=bar] Define INI entry foo with value 'bar' -e Generate extended information for debugger/profiler -f <file> Parse and execute <file>. -h This help -i PHP information -l Syntax check only (lint) -m Show compiled in modules -r <code> Run PHP <code> without using script tags <?..?> -B <begin_code> Run PHP <begin_code> before processing input lines -R <code> Run PHP <code> for every input line -F <file> Parse and execute <file> for every input line -E <end_code> Run PHP <end_code> after processing all input lines -H Hide any passed arguments from external tools. -s Output HTML syntax highlighted source. -v Version number -w Output source with stripped comments and whitespace. -z <file> Load Zend extension <file>. args... Arguments passed to script. Use -- args when first argument starts with - or script is read from stdin --ini Show configuration file names --rf <name> Show information about function <name>. --rc <name> Show information about class <name>. --re <name> Show information about extension <name>. --ri <name> Show configuration for extension <name>.  -DHAVE_CONFIG_H  -g -O2   -c /tmp/APC-3.1.9/apc.c -o apc.lo '
make: *** [apc.lo] Error 1

答案1

php-config 应该指向...php-config,而不是 php。

答案2

我将使用以下命令安装 APC:pecl install apc

除非你确实需要使用源代码。

答案3

感谢大家的回答。解决方案是:

使用此行:./configure --enable-apc --enable-apc-mmap

而是这样的:./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php

问题已解决。

相关内容