简体   繁体   中英

Globally installed Phalcon PHP devtools do not work on Windows 10, Why?

I installed Phalcon PHP as described in https://docs.phalcon.io/3.4/en/webserver-wamp . In this case the URL reads 3.4 because it applies alike for versions 4 and 5.

The WAMP server version is 3.2.6 configured with PHP 8.0.13

Everything was fine so far, so I continued installing the developer tools using composer as described in https://docs.phalcon.io/5.0/en/devtools .

Composer was installed globally and so were the developer tools, but when I type "phalcon" in the command window, the following error is shown:

C:\>phalcon

Fatal error: Uncaught Error: Class "Phalcon\Script" not found in C:\Users\Joachim\AppData\Roaming\Composer\vendor\phalcon\devtools\phalcon.php:38
Stack trace:
#0 {main}
  thrown in C:\Users\Joachim\AppData\Roaming\Composer\vendor\phalcon\devtools\phalcon.php on line 38

C:\>

PSR and Phalcon extensions were successfully installed and I can see them in the WAMP Localhost page. The Path environment variable contains the path to phalcon, composer, wamp, etc, nothing is missing as far as I can see.

Have anyone dealt with this error?

What could be the problem?

I'm a bit late answering this, but in case anyone else stumbles across it via Google the problem is that some namespaces have been altered between Phalcon4 and Phalcon5. I believe Phalcon\Config is one of those classes.

Until the devtools have been updated for Phalcon5, you'll either need to build the scaffolding manually, or copy an old Phalcon 3 or 4 project and update the namespaces.

The perils of using alpha/beta releases, unfortunately.

you didn't mention which phalcon version but since you are using php 8 the only version supporting php 8 is phalcon 5

your issue is most likely in your php.ini for the cli since wamp uses different files for apache and cli.

to fix the issue first remove the devtools package you installed globally then edit the cli php.ini in [wampDir]\bin\php\php8.0.13\php.ini and include psr and phalcon and install the devtools again using composer

you can also download the phar file here and test it in the cli

php phalcon.phar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM