我想把index.php这个文件打包成phar文档:
其文件组织是这样的:
index.php与1.php在同一个目录。
index.php 里面只有一个hello world
然后在1.php里面代码是这样的:
buildfromdirectory(dirname(__file__) . '/index.php');$phar->setstub($phar->createdefaultstub('1.php', '1.php'));$phar->compressfiles(phar::gz);
运行结果报错了:
为啥会错呢?
$phar->setstub($phar->createdefaultstub('1.php', '1.php'));参数错了吗?
这个stub是个啥东西?
这个1.php是直接运行就可以了还是使用php命令行 运行呢?
求大神解答
回复内容: 我想把index.php这个文件打包成phar文档:
其文件组织是这样的:
index.php与1.php在同一个目录。
index.php 里面只有一个hello world
然后在1.php里面代码是这样的:
buildfromdirectory(dirname(__file__) . '/index.php');$phar->setstub($phar->createdefaultstub('1.php', '1.php'));$phar->compressfiles(phar::gz);
运行结果报错了:
为啥会错呢?
$phar->setstub($phar->createdefaultstub('1.php', '1.php'));参数错了吗?
这个stub是个啥东西?
这个1.php是直接运行就可以了还是使用php命令行 运行呢?
求大神解答