-1

On Centos 6, php 5.5

I am trying to install the PHAR package with PECL. During the installation I get an "make failed" error:

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /root/tmp/pear/pear-build-rootZdozvf/phar-2.0.0/libtool --mode=compile cc  -I. -I/root/tmp/pear/phar -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootZdozvf/phar-2.0.0/include -I/root/tmp/pear/pear-build-rootZdozvf/phar-2.0.0/main -I/root/tmp/pear/phar -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/phar/util.c -o util.lo
mkdir .libs
 cc -I. -I/root/tmp/pear/phar -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootZdozvf/phar-2.0.0/include -I/root/tmp/pear/pear-build-rootZdozvf/phar-2.0.0/main -I/root/tmp/pear/phar -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/phar/util.c  -fPIC -DPIC -o .libs/util.o
/root/tmp/pear/phar/util.c: In function ‘phar_mount_entry’:
/root/tmp/pear/phar/util.c:205: error: ‘struct _php_core_globals’ has no member named ‘safe_mode’
/root/tmp/pear/phar/util.c:205: error: ‘CHECKUID_CHECK_FILE_AND_DIR’ undeclared (first use in this function)
/root/tmp/pear/phar/util.c:205: error: (Each undeclared identifier is reported only once
/root/tmp/pear/phar/util.c:205: error: for each function it appears in.)
/root/tmp/pear/phar/util.c: In function ‘phar_find_in_include_path’:
/root/tmp/pear/phar/util.c:274: warning: assignment discards qualifiers from pointer target type
/root/tmp/pear/phar/util.c: In function ‘phar_open_archive_fp’:
/root/tmp/pear/phar/util.c:854: error: ‘struct _php_core_globals’ has no member named ‘safe_mode’
/root/tmp/pear/phar/util.c:854: error: ‘CHECKUID_ALLOW_ONLY_FILE’ undeclared (first use in this function)
/root/tmp/pear/phar/util.c: In function ‘phar_add_virtual_dirs’:
/root/tmp/pear/phar/util.c:2218: warning: assignment discards qualifiers from pointer target type
make: *** [util.lo] Error 1
ERROR: `make' failed

I am not sure why, but I went to PECL and saw that the PHAR package has some dependencies, I tried installing the first dependency listed, BZ2, but then I got another error:

Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

And so I found this very useful post, which showed me how to manually download the package, put in the right place. But after running ./configure I just get a message telling me to re-intall BZ2.

And so I found out that I can run pecl install --alldeps phar to install all dependencies. I did that, and now I get the following error:

 cc -I. -I/root/tmp/pear/hash -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootm2aHqA/hash-1.5/include -I/root/tmp/pear/pear-build-rootm2aHqA/hash-1.5/main -I/root/tmp/pear/hash -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/hash/hash.c  -fPIC -DPIC -o .libs/hash.o
/root/tmp/pear/hash/hash.c:785: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:792: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:799: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:807: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:815: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:822: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:828: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:835: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:842: error: duplicate ‘static’
/root/tmp/pear/hash/hash.c:848: error: duplicate ‘static’
make: *** [hash.lo] Error 1
ERROR: `make' failed

I would appreciate any help getting phar installed. Thanks!

Note: I originally posted this on stackoverflow but figured severfault would be more appropriate.

gdaniel
  • 99
  • StackOverflow is probably a better forum for this question, but, well, why are you installing pecl/phar in this manner? how... what are you doing that you got here? What was the command you started with to run you down this dependency rabbit hole? `yum install php55w-common` will include the `php-pecl-phar` package from the repo, which doesn't seem like what you're doing here – austinian Jul 17 '15 at 03:53
  • Also, PECL/PHAR are included in PHP core as of 5.2 – austinian Jul 17 '15 at 03:56
  • I'm sorry, but why the down vote? This is a managed VPS. PHP was already installed. So what I described in my question is exactly where I started. – gdaniel Jul 17 '15 at 13:06
  • You start with "during installation", but you don't include how you kick off the installation or where the package/tarball/source/whatever it is you're using is sourced from. Are you using yum to do a source install? Are you using the "normal" repositories? – austinian Jul 17 '15 at 14:38

1 Answers1

0

http://php.net/manual/en/phar.installation.php

The Phar extension is built into PHP as of PHP version 5.3.0. Phar may be installed via the PECL extension with previous PHP versions, and the » Phar PECL page contains further information and history.

It looks like your PHP is not compiled with Phar support, you will need to recompile it in order to get Phar working.

Florin Asăvoaie
  • 7,057
  • 23
  • 35