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

not able to run CLi applications

when i try to run basic CLI appications i am getting the following error in console...why do i get this and how to rectify it.? Fatal error: Uncaught Error: Class 'Phalcon\Di\FactoryDefault\Cli' not found in C:\wamp64\www\myproject\app\cli.php:8



85.5k
edited Feb '17

probably ....

<?php

use Phalcon\Di\FactoryDefault\Cli as CliDI;

//.....
$di = new CliDI();

//....

https://php.net/manual/en/language.namespaces.php



85.5k
edited Feb '17

actually on second tought ... i guess your cli php could be different from what your apache / nginx are serving

in temrinal:

php -v
php --info

make sure its the same on both places ( terminal and web page )

edited Feb '17

yes in both the places the versions are same....but along with php7 i am using php 5.6....does this make any problem

edited Feb '17

i am using INVO as my skeleton code....does this make any difference. or do we have to load or include any path variable for phalcon classes to work in CLI.



85.5k

in cmd do you see phalcon when you do

php -m


85.5k

then its not the same php as the one apache/nginx are using. Find the executable for apache/nginx and utse ut instead

example:

c:\XAMPP\php\bin\php -m