Skip to content

Instantly share code, notes, and snippets.

@EliasZ
Created July 8, 2015 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EliasZ/8c005eb6530f90d951ba to your computer and use it in GitHub Desktop.
Save EliasZ/8c005eb6530f90d951ba to your computer and use it in GitHub Desktop.
$ phpbrew --debug ext install imagick
$ phpbrew --debug ext install imagick
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'hash.so' in Unknown on line 0
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'hash.so' in Unknown on line 0
===> Downloading from http://pecl.php.net/get/imagick-3.1.2.tgz
---> Found curl extension, using CurlDownloader
[==================================================================] 92.44/92.44KB 100%
===> /opt/phpbrew/distfiles/imagick-3.1.2.tgz downloaded.
===> Extracting to /opt/phpbrew/build/php-5.5.26/ext...
tar -C /opt/phpbrew/build/php-5.5.26/ext -xzf /opt/phpbrew/distfiles/imagick-3.1.2.tgz
rm -rf /opt/phpbrew/build/php-5.5.26/ext/imagick
mv /opt/phpbrew/build/php-5.5.26/ext/imagick-3.1.2 /opt/phpbrew/build/php-5.5.26/ext/imagick
mv /opt/phpbrew/build/php-5.5.26/ext/package.xml /opt/phpbrew/build/php-5.5.26/ext/imagick/package.xml
===> Installing imagick extension...
Extension path /opt/phpbrew/build/php-5.5.26/ext/imagick
Log stored at: /opt/phpbrew/build/php-5.5.26/ext/imagick/build.log
Changing directory to /opt/phpbrew/build/php-5.5.26/ext/imagick
===> Phpize...
Running Command:phpize > /opt/phpbrew/build/php-5.5.26/ext/imagick/build.log 2>&1
===> Configuring...
Appending argument: --with-php-config=/opt/phpbrew/php/php-5.5.26/bin/php-config
Running Command:./configure --with-php-config=/opt/phpbrew/php/php-5.5.26/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/phpbrew/php/php-5.5.26
checking for PHP includes... -I/opt/phpbrew/php/php-5.5.26/include/php -I/opt/phpbrew/php/php-5.5.26/include/php/main -I/opt/phpbrew/php/php-5.5.26/include/php/TSRM -I/opt/phpbrew/php/php-5.5.26/include/php/Zend -I/opt/phpbrew/php/php-5.5.26/include/php/ext -I/opt/phpbrew/php/php-5.5.26/include/php/ext/date/lib
checking for PHP extension directory... /opt/phpbrew/php/php-5.5.26/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /opt/phpbrew/php/php-5.5.26/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
checking ImageMagick MagickWand API configuration program... Exception: Command failed: ./configure --with-php-config=/opt/phpbrew/php/php-5.5.26/bin/php-config returns checking ImageMagick MagickWand API configuration program...
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
Notice: Undefined offset: 2 in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
3
Trace:
0) PhpBrew\Utils::system('./configure --with-php-config=/opt/phpbrew/php/php-5.5.26/bin/php-config', CLIFramework\Logger)
from phar:///usr/bin/phpbrew/PhpBrew/Extension/ExtensionInstaller.php: 2
1) PhpBrew\Extension\ExtensionInstaller->install(PhpBrew\Extension\PeclExtension, [])
from phar:///usr/bin/phpbrew/PhpBrew/Extension/ExtensionManager.php: 2
2) PhpBrew\Extension\ExtensionManager->installExtension(PhpBrew\Extension\PeclExtension, [])
from phar:///usr/bin/phpbrew/PhpBrew/Command/ExtensionCommand/InstallCommand.php: 2
3) PhpBrew\Command\ExtensionCommand\InstallCommand->execute('imagick')
PHP Notice: Undefined index: file in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
Notice: Undefined index: file in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
PHP Notice: Undefined index: line in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
Notice: Undefined index: line in phar:///usr/bin/phpbrew/CLIFramework/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 2
from : 0
4) call_user_func_array([PhpBrew\Command\ExtensionCommand\InstallCommand, 'execute'], ['imagick'])
from phar:///usr/bin/phpbrew/CLIFramework/CommandBase.php: 2
5) CLIFramework\CommandBase->executeWrapper(['imagick'])
from phar:///usr/bin/phpbrew/CLIFramework/Application.php: 2
6) CLIFramework\Application->run(['/usr/bin/phpbrew', '--debug', 'ext', 'install', 'imagick'])
from phar:///usr/bin/phpbrew/CLIFramework/Application.php: 2
7) CLIFramework\Application->runWithTry(['/usr/bin/phpbrew', '--debug', 'ext', 'install', 'imagick'])
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment