Bug #70595 [NEW]: Generating phar.phar failed under OS X 10.11
| From: | 191919 at gmail dot com | Date: | Mon, 28 Sep 2015 03:55:44 +0000 |
| Subject: | Bug #70595 [NEW]: Generating phar.phar failed under OS X 10.11 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196279@lists.php.net to get a copy of this message | ||
From: 191919 at gmail dot com
Operating system: OS X
PHP version: 7.0Git-2015-09-28 (Git)
Package: Compile Failure
Bug Type: Bug
Bug description:Generating phar.phar failed under OS X 10.11
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 bug report at https://bugs.php.net/bug.php?id=70595&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70595&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70595&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70595&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70595&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70595&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70595&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70595&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70595&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70595&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70595&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70595&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70595&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70595&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70595&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70595&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70595&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70595&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70595&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70595&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70595&r=mysqlcfg