Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phalcon php - Undefined namespace Phalcon

Tags:

php

phalcon

I am working on a project in php Phalcon.

I am working with the Xampp server. The installation process that I followed is on this link:

http://docs.phalconphp.com/en/latest/reference/install.html

I am following the documentation on the website as guide and tutorial.

My problem is, every time I type "class MyClass extends \Phalcon\Mvc\Model"

it says undefined namespace "Mvc" and in other files it also gives error that Phalcon is an undefined namespace.

The installation seems okay.

Please help me out.

like image 344
Rabbiya Shahid Avatar asked Mar 25 '26 09:03

Rabbiya Shahid


1 Answers

I think this is not really a problem with the installation of Phalcon.

I have recognized the same behaviour of my IDE because Phalcon is only loaded as an extension of PHP and not available as real PHP files which can be indexed by your IDE.

The easiest way to check if install was ok is to create a info.php in your project root.

<?php
phpinfo();

If you open this file in browser it should show a block with information about phalcon.

There is a script that creates stub files for you that can be integrated in you project.

https://github.com/phalcon/phalcon-devtools/blob/master/ide/gen-stubs.php

If these files are indexed by your IDE, the message of Undefined namespace should be gone.

like image 110
jumper85 Avatar answered Mar 27 '26 23:03

jumper85