Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
Created April 17, 2022 12:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynt-smitka/e38afa406bd67bfd03446e9397cabeb6 to your computer and use it in GitHub Desktop.
Save lynt-smitka/e38afa406bd67bfd03446e9397cabeb6 to your computer and use it in GitHub Desktop.
Redefine putenv
if (!function_exists('putenv')) {
function putenv($string){
return false;
}
}
@lynt-smitka
Copy link
Author

wp-config.php

wp-config

mu-plugin

https://wordpress.org/support/article/must-use-plugins/

<?php
/**
 * Plugin Name: Putenv fix
 * Description: Redefine disabled putenv function in PHP8+
 * Author:      Vladimir Smitka
 * Author URI:  https://lynt.cz/
 * License:     GNU General Public License v3 or later
 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
 */

defined( 'ABSPATH' ) or die( 'nothing here' );

if (!function_exists('putenv')) {
    function putenv($string){
        return false;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment