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

Create models on a remote server

Hi everyone,

After a little pause i'm coming back on my personnal website, and i've some issues, with the dev tools in order to create models on my server.

I have no clue to generate my models in local, but when i try to generate them on my server, this is the nice error sent by Mysql:

SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.

I just checked ten times my password, login etc..

I don't understand why it's not working, I found some solutions on this forum but they didn't worked at all on my problem

There is my configuration file (PDO is enabled on my server, i also checked):


return new \Phalcon\Config(array(
    'database' => array(
        'adapter'     => 'Mysql',
        'host'        => 'bdd.myserver.com',
        'username'    => 'me',
        'password'    => 'myPassword',
        'dbname'      => 'myDb',
    ),
    'application' => array(
        'controllersDir' => __DIR__ . '/../../app/controllers/',
        'modelsDir'      => __DIR__ . '/../../app/models/',
        'viewsDir'       => __DIR__ . '/../../app/views/',
        'pluginsDir'     => __DIR__ . '/../../app/plugins/',
        'libraryDir'     => __DIR__ . '/../../app/library/',
        'cacheDir'       => __DIR__ . '/../../app/cache/',
        'router'         => __DIR__ . '/../../app/config/router.php',
        'baseUri'        => '/dev/',
    )
));

That error will be because a firewall is blocking you

edited Nov '14

Yeah i thought about that too but i didn't have any firewall enabled at the time :/

It will be a firewall on the server not your computer. You need to allow connections from your IP to that port

Yeah i understood that the first time, generally you don't have problem with output but input. But i have configure the server for allowing my computer ip address it doesn't change anything ..

There may be several firewalls in place. The first thing to do is to make sure you're allowed on your servers software firewall (for CentOS 7 use firewall-cmd).

If you're still getting the same message then you may need to contact your hosting provider as they may have a hardware firewall blocking the request.