disabled by the php.ini setting phar.readonly

WBOY
Release: 2016-06-23 13:26:13
Original
3952 people have browsed it

1,最近看了一下phar模块,就是php自己的打包打包结果和java的jar类似

但是我就简单执行一行

new Phar('my-demo.phar');
Copy after login

报错啦:

报错信息:Uncaught exception 'UnexpectedValueException' with message 'creating archive "my-demo.phar" disabled by the php.ini setting phar.readonly' in

原来要把php.ini中phar.readonly 设置0

我就想我用

$r = ini_set("phar.readonly", 0);
Copy after login

不就行啦 可是返回结果为false

我就纳闷啦就php官网看看

varname不是所有有效的选项都能够用 ini_set() 来改变的。 这里有个有效选项的清单附录。
Copy after login

哦,原来

ini_set能设置不是所有的php.ini
Copy after login

看来只能再php.ini中加啦

[Phar]; http://php.net/phar.readonlyphar.readonly = Off
Copy after login

问题解决啦


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template