disabled by the php.ini setting phar.readonly

1,最近看了一下phar模塊,就是php本身的打包打包結果和java的jar相似
php

可是我就簡單執行一行java

new Phar('my-demo.phar');

報錯啦:spa

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

原來要把php.ini中phar.readonly 設置0code

我就想我用orm

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

不就行啦 但是返回結果爲falseit

我就納悶啦就php官網看看io

varname
不是全部有效的選項都可以用 ini_set() 來改變的。 這裏有個有效選項的清單附錄。

哦,原來class

ini_set能設置不是全部的php.ini

看來只能再php.ini中加啦打包

[Phar]
; http://php.net/phar.readonly
phar.readonly = Off

問題解決啦

相關文章
相關標籤/搜索