Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Redefine putenv
if (!function_exists('putenv')) {
function putenv($string){
return false;
}
}
@lynt-smitka
Copy link
Author

lynt-smitka commented Apr 17, 2022

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