Model could not be loaded while executing query [Phalcon Framework]

i get some trouble when using model query for execute in phalcon framework like this sample and the result :

$query = new Query(
“SELECT * FROM Campaign”,
$this->getDI()
);

Model ‘Campaign’ could not be loaded
#0 [internal function]: Phalcon\Mvc\Model\Manager->load(‘Campaign’, true)
#1 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()
#2 [internal function]: Phalcon\Mvc\Model\Query->parse()
#3 /var/www/html/gamanads/app/controllers/AdspaceController.php(185): Phalcon\Mvc\Model\Query->execute()
#4 [internal function]: Vokuro\Controllers\AdspaceController->offerwallAction()
#5 [internal function]: Phalcon\Dispatcher->callActionMethod(Object(Vokuro\Controllers\AdspaceController), ‘offerwallAction’, Array)
#6 [internal function]: Phalcon\Dispatcher->_dispatch()
#7 [internal function]: Phalcon\Dispatcher->dispatch()
#8 /var/www/html/gamanads/public/index.php(41): Phalcon\Mvc\Application->handle()
#9 {main}

how i solve this problem is just, get full path for the model in models folder like this.

$query = new Query(
“SELECT * FROM Vokuro\Models\Campaign”,
$this->getDI()
);

and, taraaaaaa…. works very well.

thankyou.

Expected response code 250 but got code “535”, with message “535-5.7.8 Username and Password not accepted

 

recently encountered a SwiftMail error while trying to send a mail through gmail.

Expected response code 250 but got code “535”, with message “535-5.7.8 Username and Password not accepted.
I was trying to send mail through my gmail and google thought that I was a spam(maybe because I was requesting too fast) I received a mail from them saying my account was access and I told them it was me. I was able to send mail without problem and it just occured now.

 

I researched on the internet and some answers includes enabling the “access for lesser app” and “unlocking gmail captcha” which sadly didn’t work for me until I found the 2-step verification.

What I did the following was:

  1. enable the 2-step verification to google HERE
  2. Create App Password to be use by your system HERE
  3. I selected Others (custom name) and clicked generate
  4. Went to my env file in laravel and edited thisMAIL_USERNAME=talentscoutphil@gmail.com

    MAIL_PASSWORD=thepasswordgenerated

  5. Restarted my apache server and boom! It works again.

This was my solution. I created this to atleast make other people not go wasting their time researching for a possible answer.

i hope this trick will solve the problem especially if you user php framework with mail library.

cheers.

Express : Fast, unopinionated, minimalist web framework for node.

var express = require(express)
var app = express()
 
app.get(/, function (req, res) {
  res.send(Hello World)
})
 
app.listen(3000)

Installation

$ npm install express

Features

  • Robust routing
  • Focus on high performance
  • Super-high test coverage
  • HTTP helpers (redirection, caching, etc)
  • View system supporting 14+ template engines
  • Content negotiation
  • Executable for generating applications quickly

Docs & Community

PROTIP Be sure to read Migrating from 3.x to 4.x as well as New features in 4.x.

Security Issues

If you discover a security vulnerability in Express, please see Security Policies and Procedures.

Quick Start

The quickest way to get started with express is to utilize the executable express(1) to generate an application as shown below:

Install the executable. The executable’s major version will match Express’s:

$ npm install -g express-generator@4

Create the app:

$ express /tmp/foo && cd /tmp/foo

Install dependencies:

$ npm install

Start the server:

$ npm start

Philosophy

The Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.

Express does not force you to use any specific ORM or template engine. With support for over 14 template engines via Consolidate.js, you can quickly craft your perfect framework.

Examples

To view the examples, clone the Express repo and install the dependencies:

$ git clone git://github.com/expressjs/express.git –depth 1
$ cd express
$ npm install

Then run whichever example you want:

$ node examples/content-negotiation

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

How to Install Latest Nodejs & Npm on Ubuntu 16.04 & 14.04

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Latest version node.js ppa is maintaining by its official website. We can add this PPA to Ubuntu 16.04 LTS (Trusty Tahr) and 14.04 LTS (Xenial Xerus) Systems and install node.js with few easy commands.

Install nodejs

Step 1: Add NodeJs PPA

First, you need to node.js PPA in our system provides by nodejs official website. We also need to install python-software-properties package if not installed already.

$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

Step 2: Install Nodejs and NPM

After adding required PPA file lets install Node package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.

$ sudo apt-get install nodejs

Step 3: Check Node.js and NPM Version

After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.

$ node -v 

v7.10.0

Also, check the version of installed npm.

$ npm -v 

4.2.0

Step 4: Create Demo Web Server (Optional)

This is an optional step. If you want to test your node.js install. Let’s create a web server with “Hello World!” text. Create a file http_server.js

$ vim http_server.js

and add following content

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(3001, "127.0.0.1");
console.log('Server running at http://127.0.0.1:3001/');

Now start the web server using below command.

$ node --debug http_server.js

debugger listening on port 5858
Server running at http://127.0.0.1:3001/

The web server has been started on port 3001. Now access http://127.0.0.1:3001/ URL in browser. Now you will need to configure a front-end server for your app.

 

credit : https://tecadmin.net/

Cara Install Phalcon Di Ubuntu 16.04

Pada kesempatan kali ini saya akan berbagi kepada sobat tentang cara Install Phalcon Di Ubuntu 16.04 tentu saja cara ini tidak sama seperti halnya kita Install Phalcon Di Ubuntu 14.04. Sebelum sobat menginstall ini pastikan dahulu sobat mengenal phalcon jika belum kenal sobat bisa baca artikel saya sebelumnya tentang Perkenalan Framework Phalcon dan saya akan membuat tutorial series yang artinya setiap artikel yang satu dengan yang lain saling berkaitan. Nantikan tulisan saya lainnya tentang Tutorial Phalcon yang lainnya.

Yang berbeda cara installasi phalcon diubuntu 14.04 & ubuntu 16.04 adalah versi php yang berbeda. Perlu kalian ketahui bahwa ubuntu 16.04 hanya support menginstall dan menggunakan php7 , sementara ubuntu 14.04 menggunakan php 5. Tentu sangat berbeda apabila kita install ubuntu 16.04 dengan cara ubuntu 14.04.

1. Install LAMP-stack (Apache2, Mysql, Php 7)
Untuk cara penginstallan tidak akan saya jelaskan disini karena akan menjadi artikel yang sangaat panjang hahaha untuk saya rekomendasikan sobat untuk bisa ikuti cara di : http://tecadmin.net/install-apache-mysql-php-lamp-stack-on-ubuntu-16-04/
Setelah berhasil Install LAMP-stack kita akan mulai melakukan instalasi phalcon diharap untuk ikuti baik-baik step-by-stepnya.

2. Installasi Phalcon Ubuntu 16.04
Masukan command dibawah ini melalui terminal sobat secara bertahap satu per-satu.

 

$ sudo apt-add-repository ppa:phalcon/stable
$ sudo apt-get update
$ sudo apt-get install php7.0-phalcon
$ sudo apt-get install -y gcc make re2c libpcre3-dev php7.0-dev build-essential php7.0-zip

 

3. Aktifkan Extensi Phalcon
$ sudo apt-get install gcc make autoconf libc-dev pkg-config
$ git clone --depth=1 git://github.com/phalcon/cphalcon.git
$ cd cphalcon/build
$ sudo PATH=/opt/sp/php7.0/bin:$PATH ./install
4. Tambahkan Extensi Phalcon Ke Apache
$ sudo bash -c "echo extension=phalcon.so > /etc/php7.0/conf.d/phalcon.ini"
$ sudo service php7.0-fpm restart

 

5. Cek Ekstensi Phalcon.
Cek ekstensi phalcon apakah sudah aktif atau belum.
Runing terlebih dahulu Apache2 sobat “sudo service apache2 start”
lalu buat file php.info didirektori default apache2 /var/www/html/ cari ekstensi phalcon ctrl + f phalcon.
Selamat! Kini Phalcon v.3.0.1 telah diinstall diubuntu 16.04 sobat silahkan untuk terbang bersama phalcon ?