nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.4k stars 327 forks source link

Failed to set opcache.jit #785

Open aryanbaghi opened 1 year ago

aryanbaghi commented 1 year ago

I've installed opcache with docker-php-ext-install opcache in docker image based on nginx/unit:1.28.0-php8.1 When I set "opcache.jit": "1235" in config.json, I got this error on container start:

2022/11/09 14:28:57 [info] 79#79 router started
2022/11/09 14:28:57 [info] 79#79 OpenSSL 1.1.1n  15 Mar 2022, 101010ef
2022/11/09 14:28:57 [error] 81#81 setting PHP option "opcache.jit: 1235" failed

By the way when I set this in php.ini file it works.

More info:

Unit Version: 1.28.0 PHP Version: 8.1.10 Run Environment: Docker

config.json:

{
    "listeners": {
        "*:9000": {
            "pass": "routes"
        }
    },

    "routes": [
        {
            "match": {
                "uri": [
                    "*.php",
                    "*.php/*"
                ]
            },

            "action": {
                "pass": "applications/appname/direct"
            }
        },
        {
            "action": {
                "share": "/var/www/html/public/$uri",
                "fallback": {
                    "pass": "applications/appname/index"
                }
            }
        }
    ],

    "applications": {
        "appname": {
            "type": "php",
            "user": "unit",
            "group": "unit",
            "targets": {
                "direct": {
                    "root": "/var/www/html/public/"
                },

                "index": {
                    "root": "/var/www/html/public/",
                    "script": "index.php"
                }
            },
            "options": {

                "user": {
                    ...
                    "opcache.jit": "1235"
                }
            }
        }
    }
}
tippexs commented 1 year ago

Thanks for reaching out! We will have a look into this!

meezaan commented 1 year ago

I am able to use Opcache with 8.1 at least with thos Dockerfile - https://github.com/islamic-network/php/blob/master/8/8.1/Dockerfile.nunit. Will test on 8.2 and get back.

meezaan commented 1 year ago

Works in 8.2 too - https://github.com/islamic-network/php/blob/master/8/8.2/Dockerfile.nunit.