This is PHALCON php related issue.
I tried to create new project with PHALCON by doing this.
# phalcon project blog
Phalcon DevTools (2.0.1)
Success: Controller "index" was successfully created.
Success: Project 'blog' was successfully created.
I created the controller
# cd blog
# phalcon controller poll
phalcon controller poll
Phalcon DevTools (2.0.1)
Success: Controller "poll" was successfully created.
and created my model, I edited first my config.php for the mysql db settings
# phalcon model polls
Phalcon DevTools (2.0.1)
Success: Model "polls" was successfully created.
i edited the poll controller
public function indexAction()
{
$this->view->polls = Polls::find(); //added to the original source...
}
and created my viewer as simple as
<h1>Polls</h1>
When I test it I got the error
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)
I posted this earlier and someone advice me that services.php#56 so I rectified it by entering the advice script.
//$di->set('db', function () use ($config) {
// return new DbAdapter($config->database->toArray());
//});
//But recommed setting like
$di->set(
'db',
function () use ($config) {
return new DbAdapter([
'host' => $config->database->mysql->host,
'username' => $config>database->mysql->username,
'password' => $config->database->mysql->password,
'dbname' => $config->database->mysql->dbname,
'options' => array(
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $config->database->mysql->charset
)
]);
},
true // shared
);
After applying it I just encountered similar error
SQLSTATE[HY000] [2002] No such file or directory
I need help... I want to fly with PHALCON....
localhostset for the host config setting try changing it to127.0.0.1or0.0.0.0- honerlawd