semsol / arc2

ARC RDF Classes for PHP
Other
331 stars 92 forks source link

Fatal error: Class 'ARC2\Store\Adapter\AbstractAdapter' not found in /Applications/MAMP/htdocs/1semantic/vendor/semsol/arc2/src/ARC2/Store/Adapter/mysqliAdapter.php on line 17 #132

Closed mov580 closed 4 years ago

mov580 commented 4 years ago

Hi after installing using composer and trying to run $store = ARC2::getStore($config); if (!$store->isSetUp()) { $store->setUp(); }

I received this message

k00ni commented 4 years ago

Hi @mov580, how did you include ARC2 files?

As described here: https://github.com/semsol/arc2/wiki/Getting-started-with-ARC2 ?

Did you included vendor/autoload.php ?

mov580 commented 4 years ago

Hi, Thanks for your response I added this according to the documentation include_once("path/to/arc/ARC2.php");

where should I include the vendor/autoload.php my file?

mov580 commented 4 years ago

OK seems working now but I have another error Fatal error: Cannot declare class ARC2, because the name is already in use in /Applications/MAMP/htdocs/1semantic/vendor/semsol/arc2/ARC2.php on line 15

k00ni commented 4 years ago

Hi,

your file with ARC2 should begin like the following:

<?php

require ('vendor/autoload.php');

$store = ARC2::getStore($config);
if (!$store->isSetUp()) {
    $store->setUp();
}
// ...

Please replace vendor/autoload.php with the right path on your machine. Do not include vendor/semsol/arc2/ARC2.php when you already included vendor/autoload.php, because they include almost the same files. Because of the double-include, you get the name is already in use errors.

Use vendor/autoload.php only, it should include all required files.

k00ni commented 4 years ago

@mov580: is this solved? Please close this then.