1

I am able to run in cmd phalcon -v I am also able to create a project from cmd, but whenever I open the project in the local host it throws the error:

( ! ) Fatal error: Uncaught Error: Class 'Phalcon\Di\FactoryDefault' not found in C:\wamp64\www\medical\public\index.php on line 16

I went to phpinfo on my localhost and saw that the phalcon section is missing. So strange since Im able to do phalcon -v and create a project.....

Here's my current spec, please let me know if you see something I am missing.

Phalcon DevTools (4.2.0)

Environment:
  OS: Windows NT CAROLINE 10.0 build 22621 (Windows 10) AMD64
  PHP Version: 7.4.33
  PHP SAPI: cli
  PHP Bin: C:\wamp64\bin\php\php7.4.33\php.exe
  PHP Extension Dir: C:\php\ext
  PHP Bin Dir: C:\php
  Loaded PHP config: C:\wamp64\bin\php\php7.4.33\php.ini
Versions:
  Phalcon DevTools Version: 4.2.0
  Phalcon Version: 4.0.6
  AdminLTE Version: 3.0.1

I ensured it was TS. I redownloaded the dll file and ensure the psr file was there in the php.ini. I expected when I opened the project in localhost, it would have rendered.

  • 1
    [Provide a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Mattia Righetti Mar 21 '23 at 21:46
  • For php 7.4 you will need to install Phalcon 4. Remember to include the PSR extension (v 1.0.0 https://pecl.php.net/package/psr) and double check if you need the NTS or TS dll. – Arthur Mar 22 '23 at 11:35
  • But I am using Phalcon 4.0.6. Where can I find just Phalcon 4? Yes, I included the PSR extension and my phpinfo server says Im TS. – Caroline Craig Mar 22 '23 at 16:21
  • In php.ini order matters: first you must add extension psr and below it Phalcon (btw, you can upgrade to 4.1.2). Do you see PSR in your PhpInfo()? – Arthur Mar 22 '23 at 23:00
  • On a side note, I don't understand why your question was closed: it's a clear question and related to Phalcon installation issues. You provided the error message to the only line that can be quoted as "minimal reproducible example": `` not showing Phalcon... – Arthur Mar 22 '23 at 23:07
  • I also checked the docs: https://docs.phalcon.io/4.0/en/webserver-setup#wamp For WAMP it states that the two php.ini files (for cli and Apache) must include PSR and Phalcon. This will explain why your cmd allows you to create Phalcon projects but since it seems to be missing in Apache, you cannot see it in localhost. – Arthur Mar 22 '23 at 23:41
  • Hi Arthur, yes it is marked as closed, and I try to be as clear. I do see the PSR in my phpinfo(). I can upgrade phalcon to the 4.1.2. The reason why I chose 4.0.6 is because of another thread, the person gave that version with php 7.4.33 and said it worked. I mean I can clearly run phalcon -v and when I check in wamps extension list, it shows phalcon. But when I call on the phpinfo() I do not see it there at all. – Caroline Craig Mar 23 '23 at 20:09
  • Also, I added the psr and dll to apache and to php folders. However the php.ini in apache/bin had an arrow in it and when I open it, said phpforapache. – Caroline Craig Mar 23 '23 at 20:12
  • 4.1.2 fixed a few bugs from 4.0.6 and it is working fine. Ok, so let's focus on your two php.ini files: in your question, the cmd loaded php.ini is `C:\wamp64\bin\php\php7.4.33\php.ini`. Which is the path of the php.ini loaded when you run phpinfo in your browser? That's the one that must have also PSR and Phalcon included. You can include it as `extension=psr` or `extension=php_psr.dll`, same with Phalcon dll. – Arthur Mar 23 '23 at 20:30
  • Great news, its working now! I changed it to the 4.1.2 as you suggested:Environment: OS: Windows NT CAROLINE 10.0 build 22621 (Windows 10) AMD64 PHP Version: 7.4.33 PHP SAPI: cli PHP Bin: C:\wamp64\bin\php\php7.4.33\php.exe PHP Extension Dir: C:\php\ext PHP Bin Dir: C:\php Loaded PHP config: C:\wamp64\bin\php\php7.4.33\php.ini Versions: Phalcon DevTools Version: 4.2.0 Phalcon Version: 4.1.2 AdminLTE Version: 3.0.1 – Caroline Craig Mar 23 '23 at 20:35
  • Great news indeed, cheers! (and it also proves that your question was clear and detailed enough :-) ) – Arthur Mar 23 '23 at 20:38
  • Thanks Arthur for your time. I visited the project but it throws controller error. Ugh. – Caroline Craig Mar 23 '23 at 20:42
  • With pleasure! Open a new question and we try to fix that one too :-) – Arthur Mar 23 '23 at 20:42
  • Figured that part too: https://stackoverflow.com/questions/46445522/phalconexception-namecontroller-handler-class-cannot-be-loaded Heart felt thanks with this! How can I mark this as the answer or give you points for it!!!! – Caroline Craig Mar 23 '23 at 20:54
  • Even better :-) – Arthur Mar 23 '23 at 20:55
  • One last thing, can you let me know how you were able to determine that the 4.1.2 would work? Is there like a table somewhere I can reference? – Caroline Craig Mar 23 '23 at 21:47

0 Answers0