Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法创建phar_Php_Phar - Fatal编程技术网

Php 无法创建phar

Php 无法创建phar,php,phar,Php,Phar,我正在尝试学习如何创建Phar,但我遇到了这个错误,不知道如何修复它。有什么想法吗 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '/myapp/build/myapp.phar', file extension (or combination) not recognised or the directory does not exist' in /Volum

我正在尝试学习如何创建Phar,但我遇到了这个错误,不知道如何修复它。有什么想法吗

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '/myapp/build/myapp.phar', file extension (or combination) not recognised or the directory does not exist' in /Volumes/www/vhosts/myapp/create-phar.php:11
Stack trace:
#0 /Volumes/www/vhosts/myapp/create-phar.php(11): Phar->__construct('/myapp/build/my...', 256, 'myapp.phar')
#1 {main}
  thrown in /Volumes/www/vhosts/myapp/create-phar.php on line 11

我遵循此页面的代码形式:

使用windows之类的完整路径

$srcRoot = getcwd() . '/src';
$buildRoot = getcwd() . '/build';

使用windows的完整路径,如

$srcRoot = getcwd() . '/src';
$buildRoot = getcwd() . '/build';

我一直在关注同一篇文章,问题是路径或如何在前几行中定义它们,以下是我所做的:

    $srcRoot = "src/";
    $buildRoot = "build/";

这个解决方案是针对Ubuntu12.04.3 LTS的,我一直在关注同一篇文章,问题是路径或它们在前几行中的定义,下面是我所做的:

    $srcRoot = "src/";
    $buildRoot = "build/";
此解决方案适用于Ubuntu 12.04.3 LTS