php7 oauth illegal memory allocation

后端 未结 3 1348
粉色の甜心
粉色の甜心 2021-02-20 15:16

Intro

While running inside a complex web application, a spawned php7 process tries to allocate illegal amount of memory (18446744069414584466 bytes) whe

相关标签:
3条回答
  • 2021-02-20 15:28

    An alternative to @shlm answer is to disable opcache all together.

    In my project the decrease in response time was minimal, so for me it didn't make any notable difference, if I blacklisted the file or disabled opcache.

    I disabled it with the following line in a .htaccess file.

    php_flag opcache.enable Off
    
    0 讨论(0)
  • 2021-02-20 15:31

    I encountered a similar issue and tracked it down to a problem with using the oauth extension with opcache enabled. There's actually a bug open for php for the exact situation I was experiencing - https://bugs.php.net/bug.php?id=73310. We found a potential workaround for this problem until it's fully resolved, blacklisting the files leveraging the oauth extension for opcache clears up the exception.

    You can blacklist files for opcache using the opcache.blacklist-filename option - http://php.net/manual/en/opcache.configuration.php#ini.opcache.blacklist-filename.

    • Add a txt file on your server with the full path of each file you would like to blacklist on its own line
    • Open opcache.ini in edit mode (eg sudo vi /etc/php/7.0/mods-available/opcache.ini)
    • Edit the opcache.blacklist-filename option to point to the txt file you created with the blacklisted files
    • If you are using fpm, restart it
    0 讨论(0)
  • 2021-02-20 15:34

    Out of nowhere, this worked for me like charm

    $this->oauth->fetch($endpoint, [], 'GET', ['Accept' => 'application/json']);
    

    Becomes

    $this->oauth->fetch($endpoint, ['fix'], 'GET', ['Accept' => 'application/json']);
    

    Yes, just fill the second parameter and don't leave it empty.

    0 讨论(0)
提交回复
热议问题