We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Help me : Cannot redeclare class Phalcon\Config

i run phalcon developer tools error : PHP Fatal error: Cannot redeclare class Phalcon\Config in /var/www/phalcon/html/vendor/phalcon/devtools/ide/1.2.6/Phalcon/Config.php on line 31;

i want multi modules , I have corrected one of its seats

I tried phalcon scaffold tablename --directory= but don't work! Please help me directory My Source /var/www/phalcon/html/

<?php file index.php in folder public use Phalcon\Loader; use Phalcon\Mvc\View; use Phalcon\Mvc\Application; use Phalcon\Di\FactoryDefault; use Phalcon\Mvc\Url as UrlProvider; use Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;

try {

error_reporting(E_ERROR);
$path = dirname(__DIR__);
include $path . '/library/defined.php';

// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
    return false;
}

// Register an autoloader
$loader = new Loader();
$loader->registerDirs(array(
    '../app/controllers/',
    '../app/models/'
))->register();

// Create a DI
$di = new FactoryDefault();

// Setup the view component
$di->set('view', function () {
    $view = new View();
    $view->setViewsDir('../app/views/');
    return $view;
});

// Setup a base URI so that all generated URIs include the "tutorial" folder
$di->set('url', function () {
    $url = new UrlProvider();
    $url->setBaseUri('/phalcon/');
    return $url;
});

// Handle the request
$application = new Application($di);

// Setup autoloading from vendor
include '../vendor/autoload.php';

echo $application->handle()->getContent();

} catch (\Exception $e) { echo "Exception: ", $e->getMessage(); }

Please help me!

devtools/ide/1.2.6/Phalcon/Config.php shouldn't be included/required in your PHP source code. Everything under the ide folder are only stubs, so editors know the parameters and return types for methods.