简体   繁体   English

PHP Phar安装

[英]PHP Phar installation

I'm trying to install phar extension using pecl, on my linux mint, but it keeps failing. 我正在尝试在Linux Mint上使用pecl安装phar扩展,但是它一直失败。

If I run pecl install phar I get this error: 如果我运行pecl install phar此错误:

running: make
/bin/bash /tmp/pear/temp/pear-build-rootPgumyZ/phar-2.0.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/phar -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootPgumyZ/phar-2.0.0/include -I/tmp/pear/temp/pear-build-rootPgumyZ/phar-2.0.0/main -I/tmp/pear/temp/phar -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/phar/util.c -o util.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/phar -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootPgumyZ/phar-2.0.0/include -I/tmp/pear/temp/pear-build-rootPgumyZ/phar-2.0.0/main -I/tmp/pear/temp/phar -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/phar/util.c  -fPIC -DPIC -o .libs/util.o
In file included from /usr/include/php5/main/fopen_wrappers.h:25:0,
                 from /usr/include/php5/main/php.h:402,
                 from /tmp/pear/temp/phar/phar_internal.h:27,
                 from /tmp/pear/temp/phar/util.c:23:
/tmp/pear/temp/phar/util.c: In function 'phar_mount_entry':
/usr/include/php5/main/php_globals.h:32:29: error: 'struct _php_core_globals' has no member named 'safe_mode'
 # define PG(v) (core_globals.v)
                             ^
/tmp/pear/temp/phar/util.c:205:6: note: in expansion of macro 'PG'
  if (PG(safe_mode) && !is_phar && (!php_checkuid(entry.tmp, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
      ^
/tmp/pear/temp/phar/util.c:205:67: error: 'CHECKUID_CHECK_FILE_AND_DIR' undeclared (first use in this function)
  if (PG(safe_mode) && !is_phar && (!php_checkuid(entry.tmp, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                                                                   ^
/tmp/pear/temp/phar/util.c:205:67: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/phar/util.c: In function 'phar_find_in_include_path':
/tmp/pear/temp/phar/util.c:274:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
  fname = zend_get_executed_filename(TSRMLS_C);
        ^
In file included from /usr/include/php5/main/fopen_wrappers.h:25:0,
                 from /usr/include/php5/main/php.h:402,
                 from /tmp/pear/temp/phar/phar_internal.h:27,
                 from /tmp/pear/temp/phar/util.c:23:
/tmp/pear/temp/phar/util.c: In function 'phar_open_archive_fp':
/usr/include/php5/main/php_globals.h:32:29: error: 'struct _php_core_globals' has no member named 'safe_mode'
 # define PG(v) (core_globals.v)
                             ^
/tmp/pear/temp/phar/util.c:854:6: note: in expansion of macro 'PG'
  if (PG(safe_mode) && (!php_checkuid(phar->fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
      ^
/tmp/pear/temp/phar/util.c:854:57: error: 'CHECKUID_ALLOW_ONLY_FILE' undeclared (first use in this function)
  if (PG(safe_mode) && (!php_checkuid(phar->fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
                                                         ^
/tmp/pear/temp/phar/util.c: In function 'phar_add_virtual_dirs':
/tmp/pear/temp/phar/util.c:2218:12: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
  while ((s = zend_memrchr(filename, '/', filename_len))) {
            ^
make: *** [util.lo] Error 1
ERROR: `make' failed

At the beggining I get this message: 在开始时,我收到以下消息:

Did not download optional dependencies: pecl/bz2, pecl/hash, use --alldeps to download automatically

So I've tried to install both dependencies but those also give an error: 因此,我尝试安装两个依赖项,但这些依赖项也会产生错误:

For pecl/hash: 对于pecl / hash:

/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/hash/hash.c  -fPIC -DPIC -o .libs/hash.o
/tmp/pear/temp/hash/hash.c:785:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash, 0, 0, 2)
 ^
/tmp/pear/temp/hash/hash.c:792:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_file, 0, 0, 2)
 ^
/tmp/pear/temp/hash/hash.c:799:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac, 0, 0, 3)
 ^
/tmp/pear/temp/hash/hash.c:807:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac_file, 0, 0, 3)
 ^
/tmp/pear/temp/hash/hash.c:815:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_init, 0, 0, 1)
 ^
/tmp/pear/temp/hash/hash.c:822:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO(arginfo_hash_update, 0)
 ^
/tmp/pear/temp/hash/hash.c:828:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_stream, 0, 0, 2)
 ^
/tmp/pear/temp/hash/hash.c:835:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_file, 0, 0, 2)
 ^
/tmp/pear/temp/hash/hash.c:842:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_final, 0, 0, 1)
 ^
/tmp/pear/temp/hash/hash.c:848:1: error: duplicate 'static'
 ZEND_BEGIN_ARG_INFO(arginfo_hash_algos, 0)
 ^
make: *** [hash.lo] Error 1
ERROR: `make' failed

And for pecl/bz2 (which is deprecated in favor of "channel:// http://php.net/bzip2/ext/bz2 "): 对于pecl / bz2(不赞成使用“ channel:// http://php.net/bzip2/ext/bz2 ”):

running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

ERROR: `phpize' failed

I've search for this phpize error and I found out that php5-dev must be installed (which it is). 我搜索了此phpize错误,发现必须安装php5-dev(确实如此)。

Can anyone help me figure this one out? 谁能帮我解决这个问题?

Thank you 谢谢

You don't have to use pecl/phar anymore; 您不再需要使用pecl / phar; phar is part of the PHP core since some years now. 从现在开始,phar已成为PHP核心的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM