Phpbrew: Don't install gettext extension

Created on 13 Dec 2015  路  1Comment  路  Source: phpbrew/phpbrew

PHP: 5.6.16
OS: OS X 10.9.5

$ phpbrew -d ext install gettext
===> Installing gettext extension...
Extension path /Volumes/Home/bupy7/.phpbrew/build/php-5.6.16/ext/gettext
Log stored at: /Volumes/Home/bupy7/.phpbrew/build/php-5.6.16/ext/gettext/build.log
Changing directory to /Volumes/Home/bupy7/.phpbrew/build/php-5.6.16/ext/gettext
===> Phpize...
Running Command:phpize > /Volumes/Home/bupy7/.phpbrew/build/php-5.6.16/ext/gettext/build.log 2>&1
===> Configuring...
Appending argument: --with-php-config=/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/bin/php-config
Running Command:./configure --with-php-config=/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin13.4.0
checking host system type... x86_64-apple-darwin13.4.0
checking target system type... x86_64-apple-darwin13.4.0
checking for PHP prefix... /Volumes/Home/bupy7/.phpbrew/php/php-5.6.16
checking for PHP includes... -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php/main -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php/TSRM -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php/Zend -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php/ext -I/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php/ext/date/lib
checking for PHP extension directory... /Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.7.5 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for GNU gettext support... yes, shared
configure: error: Cannot locate header file libintl.h
Exception: Command failed: ./configure --with-php-config=/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/bin/php-config returns checking for GNU gettext support... yes, shared
Thrown from phar:///usr/bin/phpbrew/PhpBrew/Utils.php at line 2:

    1<?php
>   2namespace PhpBrew; use Exception; use CLIFramework\Logger; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; class Utils { public static function canonicalizeBuildName($version) { if (!preg_match('/^php-/', $version)) { return 'php-' . $version; } return $version; } public static function support64bit() { $int = "9223372036854775807"; $int = intval($int); if ($int == 9223372036854775807) { return true; } elseif ($int == 2147483647) { return false; } else { return false; } } public static function findBinByPrefix($bin) { $prefixes = self::getLookupPrefixes(); foreach ($prefixes as $prefix) { $binPath = $prefix . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . $bin; if (file_exists($binPath)) { return $binPath; } $binPath = $prefix . DIRECTORY_SEPARATOR . 'sbin' . DIRECTORY_SEPARATOR . $bin; if (file_exists($binPath)) { return $binPath; } } return null; } public static function findLibDir() { $prefixes = array( '/opt', '/opt/local', '/usr', '/usr/local', ); if ($pathStr = getenv('PHPBREW_LOOKUP_PREFIX')) { $paths = explode(':', $pathStr); foreach ($paths as $path) { $prefixes[] = $path; } } $prefixes = array_reverse($prefixes); foreach($prefixes as $prefix) { if ($arch = self::detectArch($prefix)) { return "lib/$arch"; } } return NULL; } public static function detectArch($prefix) { $multiArchs = array( 'lib/lib64', 'lib/lib32', 'lib64', 'lib', 'lib/ia64-linux-gnu', 'lib/x86_64-linux-gnu', 'lib/x86_64-kfreebsd-gnu', 'lib/i386-linux-gnu', ); foreach ($multiArchs as $archName) { if (file_exists("$prefix/$archName")) { return $archName; } } return NULL; } public static function getLookupPrefixes() { $prefixes = array( '/opt', '/opt/local', '/opt/local/lib', '/usr', '/usr/lib', '/usr/local', '/usr/local/lib' ); if ($pathStr = getenv('PHPBREW_LOOKUP_PREFIX')) { $paths = explode(':', $pathStr); foreach ($paths as $path) { $prefixes[] = $path; } } foreach($prefixes as $prefix) { if ($arch = self::detectArch($prefix)) { $prefixes[] = "$prefix/$arch"; } } return array_reverse($prefixes); } public static function findIncludePath() { $files = func_get_args(); $prefixes = self::getLookupPrefixes(); foreach ($prefixes as $prefix) { foreach ($files as $file) { $dir = $prefix . DIRECTORY_SEPARATOR . 'include'; $path = $dir . DIRECTORY_SEPARATOR . $file; if (file_exists($path)) { return $dir; } } } return null; } public static function findLibPrefix() { $files = func_get_args(); $prefixes = self::getLookupPrefixes(); foreach ($prefixes as $prefix) { foreach ($files as $file) { $p = $prefix . DIRECTORY_SEPARATOR . $file; if (file_exists($p)) { return $prefix; } } } return null; } public static function findIncludePrefix() { $files = func_get_args(); $prefixes = self::getLookupPrefixes(); foreach ($prefixes as $prefix) { foreach ($files as $file) { if (file_exists($prefix . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . $file)) { return $prefix; } } } return null; } public static function getPkgConfigPrefix($package) { $cmd = 'pkg-config --variable=prefix ' . $package; $process = new Process($cmd); $process->run(); return trim($process->getOutput()); } static public function system($command, $logger = NULL) { if (is_array($command)) { $command = join(' ', $command); } if ($logger) { $logger->debug("Running Command:" . $command); } $lastLine = system($command, $returnValue); if ($returnValue !== 0) { throw new Exception("Command failed: $command returns " . $lastLine); } return $returnValue; } public static function findBin($bin) { $path = getenv('PATH'); $paths = explode(PATH_SEPARATOR, $path); foreach ($paths as $path) { $f = $path . DIRECTORY_SEPARATOR . $bin; if (file_exists($f)) { while (is_link($f)) { $f = readlink($f); } return $f; } } return null; } public static function pipeExecute($command) { $proc = proc_open( $command, array( array("pipe","r"), array("pipe","w"), array("pipe","w"), ), $pipes ); return stream_get_contents($pipes[1]); } public static function startsWith($haystack, $needle) { return $needle === "" || strpos($haystack, $needle) === 0; } public static function endsWith($haystack, $needle) { return $needle === "" || substr($haystack, -strlen($needle)) === $needle; } public static function findLatestPhpVersion($version = null) { $foundVersion = false; $buildDir = Config::getBuildDir(); $hasPrefix = self::startsWith($version, 'php-'); if (is_dir($buildDir)) { if ($hasPrefix == true) { $version = str_replace('php-', '', $version); } $fp = opendir($buildDir); if ($fp !== false) { while ($file = readdir($fp)) { if ($file === '.' || $file === '..' || is_file($buildDir . DIRECTORY_SEPARATOR . $file) ) { continue; } $curVersion = strtolower(preg_replace('/^[\D]*-/', '', $file)); if (self::startsWith($curVersion, $version) && version_compare($curVersion, $foundVersion, '>=')) { $foundVersion = $curVersion; if (version_compare($foundVersion, $version, '=')) { break; } } } closedir($fp); } if ($hasPrefix == true && $foundVersion !== false) { $foundVersion = 'php-'.$foundVersion; } } return $foundVersion; } static public function recursive_unlink($path, Logger $logger) { $directoryIterator = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS); $it = new RecursiveIteratorIterator($directoryIterator, RecursiveIteratorIterator::CHILD_FIRST); foreach ($it as $file) { $logger->debug("Deleting " . $file->getPathname()); if ($file->isDir()) { rmdir($file->getPathname()); } else { unlink($file->getPathname()); } } if (is_dir($path)) { rmdir($path); } elseif (is_file($path)) { unlink($path); } } static public function editor($file) { $tty = exec("tty"); $editor = escapeshellarg(getenv('EDITOR') ?: 'nano'); exec("{$editor} {$file} > {$tty}"); } }
PHP Notice:  Undefined offset: 2 in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpbrew:0
PHP   2. require() /usr/bin/phpbrew:6
PHP   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
PHP   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
PHP   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpCodeBlock() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

Notice: Undefined offset: 2 in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2

Call Stack:
    0.0002     229224   1. {main}() /usr/bin/phpbrew:0
    0.0027     392984   2. require('phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php') /usr/bin/phpbrew:6
    0.0059     881560   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
    3.2896    3898520   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
    3.2898    3898904   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpCodeBlock() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

    3

Trace:

    0) PhpBrew\Utils::system('./configure --with-php-config=/Volumes/Home/bupy7/.phpbrew/php/php-5.6.16/bin/php-config', CLIFramework\Logger)
        from phar:///usr/bin/phpbrew/PhpBrew/Extension/ExtensionInstaller.php: 2

    1) PhpBrew\Extension\ExtensionInstaller->install(PhpBrew\Extension\M4Extension, [])
        from phar:///usr/bin/phpbrew/PhpBrew/Extension/ExtensionManager.php: 2

    2) PhpBrew\Extension\ExtensionManager->installExtension(PhpBrew\Extension\M4Extension, [])
        from phar:///usr/bin/phpbrew/PhpBrew/Command/ExtensionCommand/InstallCommand.php: 2

    3) PhpBrew\Command\ExtensionCommand\InstallCommand->execute('gettext')
PHP Notice:  Undefined index: file in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpbrew:0
PHP   2. require() /usr/bin/phpbrew:6
PHP   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
PHP   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
PHP   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpTrace() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

Notice: Undefined index: file in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2

Call Stack:
    0.0002     229224   1. {main}() /usr/bin/phpbrew:0
    0.0027     392984   2. require('phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php') /usr/bin/phpbrew:6
    0.0059     881560   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
    3.2896    3898520   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
    3.2921    3899176   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpTrace() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

PHP Notice:  Undefined index: line in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpbrew:0
PHP   2. require() /usr/bin/phpbrew:6
PHP   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
PHP   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
PHP   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpTrace() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

Notice: Undefined index: line in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2

Call Stack:
    0.0002     229224   1. {main}() /usr/bin/phpbrew:0
    0.0027     392984   2. require('phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php') /usr/bin/phpbrew:6
    0.0059     881560   3. CLIFramework\Application->runWithTry() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
    3.2896    3898520   4. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dump() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
    3.2921    3899176   5. CLIFramework\ExceptionPrinter\DevelopmentExceptionPrinter->dumpTrace() phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php:2

        from : 0

    4) call_user_func_array([PhpBrew\Command\ExtensionCommand\InstallCommand, 'execute'], ['gettext'])
        from phar:///usr/bin/phpbrew/CLIFramework/CommandBase.php: 2

    5) CLIFramework\CommandBase->executeWrapper(['gettext'])
        from phar:///usr/bin/phpbrew/CLIFramework/Application.php: 2

    6) CLIFramework\Application->run(['/usr/bin/phpbrew', '-d', 'ext', 'install', 'gettext'])
        from phar:///usr/bin/phpbrew/CLIFramework/Application.php: 2

    7) CLIFramework\Application->runWithTry(['/usr/bin/phpbrew', '-d', 'ext', 'install', 'gettext'])
        from phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php: 2

    8) require('phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php')
        from /usr/bin/phpbrew: 6

Most helpful comment

Resolved:

sudo find / -name libintl.h

after

phpbrew ext install gettext -- --with-gettext=/usr/local/Cellar/gettext/0.19.3_1

>All comments

Resolved:

sudo find / -name libintl.h

after

phpbrew ext install gettext -- --with-gettext=/usr/local/Cellar/gettext/0.19.3_1
Was this page helpful?
0 / 5 - 0 ratings