On a RHEL server I cannot seem to run PhpUnit. Here are examples as root to illustrate the steps that I've tried to install PhpUnit and how it does not run:
# wget https://phar.phpunit.de/phpunit.phar
# chmod +x phpunit.phar
# ./phpunit --version
PHP Fatal error: require(): Failed opening required 'phar://phpunit-4.3.4.phar/phpunit/TextUI/Command.php' (include_path='.:') in /usr/local/bin/phpunit on line 592
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/phpunit:0
PHP 2. {closure}() /usr/local/bin/phpunit:0
# mv phpunit.phar /usr/local/bin/phpunit
# which phpunit
/usr/local/bin/phpunit
# phpunit --version
PHP Fatal error: require(): Failed opening required 'phar://phpunit-4.3.4.phar/phpunit/TextUI/Command.php' (include_path='.:') in /usr/local/bin/phpunit on line 592
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/phpunit:0
PHP 2. {closure}() /usr/local/bin/phpunit:0
It seems that PHP is choking on the phar://
address format defined on line 13:
# cat /usr/local/bin/phpunit | awk 'NR==592'
require __PHPUNIT_PHAR_ROOT__ . $classes[$class];
# cat /usr/local/bin/phpunit | grep -n __PHPUNIT_PHAR_ROOT__
13:define('__PHPUNIT_PHAR_ROOT__', 'phar://phpunit-4.3.4.phar');
592: require __PHPUNIT_PHAR_ROOT__ . $classes[$class];
601: print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
20811: if (defined('__PHPUNIT_PHAR_ROOT__')) {
20812: $prefix = __PHPUNIT_PHAR_ROOT__;
26020: copy(__PHPUNIT_PHAR_ROOT__ . '/ca.pem', $caFile);
The server is RHEL 6.5:
# uname -a
Linux foobar 2.6.32-220.38.1.el6.x86_64 #1 SMP Wed May 15 08:34:56 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/issue
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Kernel \r on an \m