Bug #70595 [Opn->Fbk]: Generating phar.phar failed under OS X 10.11

From: Date: Wed, 03 Feb 2021 13:15:24 +0000
Subject: Bug #70595 [Opn->Fbk]: Generating phar.phar failed under OS X 10.11
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231912@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70595&edit=1 ID: 70595 Updated by: cmb@php.net Reported by: 191919 at gmail dot com Summary: Generating phar.phar failed under OS X 10.11 -Status: Open +Status: Feedback Type: Bug Package: Compile Failure Operating System: OS X PHP Version: 7.0Git-2015-09-28 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Is this still an issue with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2015-09-28 03:55:43] 191919 at gmail dot com Description: ------------ dev failed to build under OS X 10.11 when generating phar.phar. ``` $ rm -rf /opt/php7 $ ./buildconf $ ./configure --prefix=/opt/php7 --enable-opcache $ make ... ... ... Generating phar.phar Parse error: syntax error, unexpected end of file in /Users/XX/box/php-src/ext/phar/phar.php on line 3 make: *** [ext/phar/phar.phar] Error 255 ``` I checked the generated phar.php, which looks like an error message output elsewhere. ``` $ cat /Users/XX/box/php-src/ext/phar/phar.php Parse error: syntax error, unexpected ''<'' (T_ENCAPSED_AND_WHITESPACE), expecting '(' in /Users/XX/box/php-src/ext/phar/build_precommand.php on line 2 ``` build_precommand.php looks like totally valid: ``` $ cat /Users/XX/box/php-src/ext/phar/build_precommand.php #!/usr/bin/php <?php echo '<'.'?php';?> /** @file phar.php * @ingroup Phar * @brief class Phar Pre Command * @author Marcus Boerger * @date 2007 - 2008 * * Phar Command */ foreach(array("SPL", "Reflection", "Phar") as $ext) { if (!extension_loaded($ext)) { echo "$argv[0] requires PHP extension $ext.\n"; exit(1); } } <?php $classes = array( 'DirectoryTreeIterator', 'DirectoryGraphIterator', 'InvertedRegexIterator', 'CLICommand', 'PharCommand', ); foreach($classes as $name) { echo "if (!class_exists('$name', 0))\n{\n"; $f = file(dirname(__FILE__) . '/phar/' . strtolower($name) . '.inc'); unset($f[0]); $c = count($f); while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) { unset($f[$c--]); } if (substr($f[$c], -2) == "\r\n") { $f[$c] = substr($f[$c], 0, -2); } if (substr($f[$c], -1) == "\n") { $f[$c] = substr($f[$c], 0, -1); } if (substr($f[$c], -2) == '?>') { $f[$c] = substr($f[$c], 0,-2); } while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) { unset($f[$c--]); } echo join('', $f); echo "\n}\n\n"; } echo 'new PharCommand($argc, $argv);'."\n"; ?> ``` ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70595&edit=1

« previous php.bugs (#231912) next »