catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Php stops processing at "new Medoo" statement #649

Closed nrcionline closed 3 years ago

nrcionline commented 6 years ago

I've tried everything I can think of but the php code appears to abort right after I call the new Medoo function. I've run PHP info to verify the driver is installed. Should be working, but it doesn't. The connection prints out fine. I never see any exception, and I never get to the "after new Medoo"

<?php
echo "Hello World";
echo phpversion('tidy');
echo PHP_OS;
if (strstr(PHP_OS, 'WIN'))
{
  echo "yes";
}
else
{
  echo "no";
}

    // If you installed via composer, just use this code to requrie autoloader on the top of your projects.
    require 'vendor/autoload.php';
     echo "2";
    // Using Medoo namespace
    use Medoo\Medoo;
     echo "2";
 $connection = array(
        'database_type' => 'mssql',
        'database_name' => 'name',
        'server' => 'server',
        'username' => 'un',
        'password' => 'pw'
    );
print_r($connection);
echo "\r\n";
echo "new Medoo";
    // Initialize
try {
echo "test";
        $database = new Medoo($connection);
print_r($database->info());
} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

echo "after new Medoo";
print_r($database);

     echo $database->error();
     echo $database.database_type;
     echo $database->database_type;
kuofp commented 6 years ago

Could you please enable display error, and provide more info. And I found everything works fine except the error which is raised at the last 2 lines. Cannot access protected property Medoo\Medoo::$database_type

nimbusLiQuid commented 6 years ago

Same issue for me.