PHP - Issue with dotenv on host

Hi all, I am getting this error on my Hostwinds account:

Fatal error: Uncaught TypeError: Return value of Symfony\Component\Dotenv\Dotenv::populate() must be an instance of Symfony\Component\Dotenv\void, none returned in /home/kjzotpry/public_html/ Stack trace: #0 /home/kjzotpry/public_html/ Symfony\Component\Dotenv\Dotenv->populate(Array, false) #1 /home/kjzotpry/public_html/ Symfony\Component\Dotenv\Dotenv->doLoad(false, Array) #2 /home/kjzotpry/public_html/ Symfony\Component\Dotenv\Dotenv->load('../.env') #3 {main} thrown in /home/kjzotpry/public_html/ on line 146

However, on localhost it works perfectly.

How can I fix this?

This is my code:

require '../vendor/autoload.php';

use Symfony\Component\Dotenv\Dotenv;

$dotenv = new Dotenv();

// Constants. USE .ENV
$servername = getenv('SERVER');
$username = getenv('USER');
$password = getenv('PASS');
$dbname = getenv('DBNAME');

// Get values from form
$name=$_POST['name']; // set name from form to the variable 'name'
$location=$_POST['location']; // set location from form to the variable 'location'
$email=$_POST['email']; // set the email from the form to the variable form
$review=$_POST['review']; // review from form to variable form
$userinfo = date('Y-m-d H:i:s') . " - $_SERVER[REMOTE_ADDR]"; // collect info about the user

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
	die("Connection failed: " . $conn->connect_error);

$statement  = $conn->prepare("INSERT INTO reviewlist (name, location, review, userinfo, email, rating) VALUES(?,?,?,?,?,?)");
$statement->bind_param("ssssss", $name, $location, $review, $userinfo, $email, $rating);

if ($statement->execute() === TRUE) {
	header("Location: ../reviewgood.html");
} else {
	echo "Error: " . $sql . "<br>" . $conn->error;



I had to upgrade from 5.6 to 7.2 and now am getting this error. No idea how to fix it :confounded: