Disabled by the php.ini setting phar.readonly

Source: Internet
Author: User
Tags php website
1, recently looked at the Phar module, is PHP's own packaging results and Java jar Similar

But I'm just going to do a single line

New Phar (' My-demo.phar ');

Error:

Error message: uncaught exception ' unexpectedvalueexception ' with message ' creating archive ' My-demo.phar ' disabled by the php.ini s Etting phar.readonly ' in

Originally to put php.ini in Phar.readonly set 0

I just thought I'd use

$r = Ini_set ("Phar.readonly", 0);

No, it's OK. But the return result is false

I'm just wondering, just look at the PHP website.

VarName not all valid options can be changed with Ini_set (). Here is an appendix to the list of valid options.

Oh, it turns out

Ini_set can set not all the php.ini

It seems that we can only php.ini.

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

Problem solved.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.