Taking Yii2 as an example
The process of packaging files is simple, but after packaging, always error:
PHP Fatal error:uncaught yii\base\invalidparamexception:the directory does not exist:phar:///users/jimmy/php/library/ Yii2-advanced/yii2.phar/console in phar:///users/jimmy/php/library/yii2-advanced/yii2.phar/base/module.php:224
At first, I thought it was a problem. There are files that have not been packed in, changed in various poses to pack, or reported all kinds of mistakes.
Finally there is no way to see the error of the file, found that the Realpath to determine whether the path exists, commented out, basically normal. This is a PHP bug.
/** * Sets the root directory of the module. * This method can only be invoked at the beginning of the constructor. * @param string $path the root directory of the module. This can be either a directory name or a path alias. * @throws InvalidParamException if the directory does not exist. */public function setBasePath($path){ $path = Yii::getAlias($path); $p = $path;//realpath(); if ($p !== false && is_dir($p)) { $this->_basePath = $p; } else { throw new InvalidParamException("The directory does not exist: $path"); }}
Http://git.oschina.net/web3d/codes/zyhsoev0b3i9u5njgaf42
The above describes the YII2 framework package into the Phar Package error experience, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.