Phalcon - Class "Phalcon\Config" not found - php

I've installed Phalcon and trying to create new project: phalcon project store. But instead of this I get these errors:
PHP Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48
Stack trace:
#0 C:\Composer\vendor\phalcon\devtools\src\Commands\Builtin\Project.php(74): Phalcon\DevTools\Builder\Component\AbstractComponent->__construct(Array)
#1 C:\Composer\vendor\phalcon\devtools\src\Script.php(109): Phalcon\DevTools\Commands\Builtin\Project->run(Array)
#2 C:\Composer\vendor\phalcon\devtools\src\Script.php(148): Phalcon\DevTools\Script->dispatch(Object(Phalcon\DevTools\Commands\Builtin\Project))
#3 C:\Composer\vendor\phalcon\devtools\phalcon(65): Phalcon\DevTools\Script->run()
#4 {main}
thrown in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48
Stack trace:
#0 C:\Composer\vendor\phalcon\devtools\src\Commands\Builtin\Project.php(74): Phalcon\DevTools\Builder\Component\AbstractComponent->__construct(Array)
#1 C:\Composer\vendor\phalcon\devtools\src\Script.php(109): Phalcon\DevTools\Commands\Builtin\Project->run(Array)
#2 C:\Composer\vendor\phalcon\devtools\src\Script.php(148): Phalcon\DevTools\Script->dispatch(Object(Phalcon\DevTools\Commands\Builtin\Project))
#3 C:\Composer\vendor\phalcon\devtools\phalcon(65): Phalcon\DevTools\Script->run()
#4 {main}
thrown in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
My PHP version is 8.0.8 Thread Safe x64, I've installed PSR extension and Phalcon 5.0.0 from here: https://github.com/phalcon/cphalcon/releases/tag/v5.0.0beta3, file phalcon-php8.0-ts-windows2019-vs16-x64.zip, that means I have compatible version of framework. phalcon.bat was added to environment variables. What's the problem?

Usually this error occurs when the extension is not loaded by php, see with phpinfo(), also run the componser install insider phalcon-devtools, but probably it is the php not loading the phalcon extension or PHP is not in the windows PATH , also check if the php-fpm log does not contain any extension loading errors, test in cmd the command php -v
also create a index.php and try it
<?php
use Phalcon\Mvc\Micro;
$app = new Micro();
$app->get('/', function () { echo "<h1>test</h1>";});
$app->handle();

Try do the following Go to Edit The system environment variables -> system variables -> path -> edit add phalcon.bat folder path testing here i used C:\Users\renato\Downloads\phalcon-devtools-4.2.0\phalcon-devtools-4.2.0 ( just path folder where the .sh/.bat it is, do not include the file and extension) and worked fine with php 8.0.16 windows 10 phalcon 5
and then go to the power shell and input phalcon
https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
Do not forget to run composer install inside phalcon devtools folder.
also on powershell input php -m to see the loaded modules and if it has an error

Related

How to repeat an example with Ratchet Push?

I would like to repeat the Ratchet Push example. Downloaded Composer. In the project folder via the console (CLI) I entered: php composer.phar require cboden/ratchet, after which the vendor folder and a pair of files from Composer appeared. I installed ZeroMQ and tried two installation options:
Downloaded the necessary files from
https://pecl.php.net/package/zmq/1.1.3/windows. - libzmq.dll unpacked in C:\xampp\php,- php_zmq.php in C:\xampp\php\ext.Added the C:\xampp\php\ext to system variable PATH,+ restarted the computer, + restarted the web server.
Downloaded the necessary files from
https://pecl.php.net/package/zmq/1.1.3/windows.- libzmq.dll unpacked
in C:\xampp\php\windowsXamppPhp,- php_zmq.php in C:\xampp\php\windowsXamppPhp\ext.Added the C:\xampp\php\windowsXamppPhp\ext to system variable PATH,+ restarted the computer,+ restarted the web server.
I also tried to throw the file libzmq.dll into the same folder as php_zmq.php.
The installation was guided by:https://wiki.zeromq.org/bindings:php+
https://superuser.com/questions/585291/installing-...
After all, started the xampp server, then in the console entered: php push-server.php, but the console throws an error :
> PHP Fatal error: Uncaught Error: Class 'React\ZMQ\Context' not found
> in C:\xampp\htdocs\test\push-server.php:9 Stack trace:
> #0 {main} thrown in C:\xampp\htdocs\test\push-server.php on line 9
>
> Fatal error: Uncaught Error: Class 'React\ZMQ\Context' not found in
> C:\xampp\htdocs\test\push-server.php:9 Stack trace:
> #0 {main} thrown in C:\xampp\htdocs\test\push-server.php on line 9
P.S.: I believe that something is wrong with the installation of ZeroMQ since the file was not working.
ОС: windows 10
Server: XAMPP
PHP version: 7.4.2

PHP fatal error uncaught exception after installing magento2

I have installed magento2 in my linux centos7. After installing magento2 successfully while accessing the web page is getting following error with empty content.
{{menuState.title}}
PHP version:7.1.3
OS: centos7
And the PHP-fpm error log has following error.
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Zend_Controller_Plugin_Abstract::setResponse() must be an instance of Zend_Controller_Response_Abstract, instance of Magento\Framework\HTTP\PhpEnvironment\Response given, called in /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php on line 61 and defined in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php:70
Stack trace:
#0 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php(61): Zend_Controller_Plugin_Abstract->setResponse(Object(Magento\Framework\HTTP\PhpEnvironment\Response))
#1 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard.php(195): Magento\Framework\Profiler\Driver\Standard\Output\Firebug->display(Object(Magento\Framework\Profiler\Driver\Standard\Stat))
#2 [internal function]: Magento\Framework\Profiler\Driver\Standard->display()
#3 {main}
thrown in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php on line 70
How can I resolve this error?
This was a Magento Bug reported ...
But it's already been ...
https://github.com/magento/magento2/issues/7068
So, come on ...
Did you update the magento? What is the current version?
I found this information at the base of Magento: https://devdocs.magento.com/guides/v2.3/config-guide/bootstrap/mage-profiler.html
You have this option ...
The temporary fix is install symfony / yaml from dev branch and then our module:
              composer require symfony/yaml: dev-issue-814
    
          composer require mirasvit/module-profiler
Try using / installing php7.2
See this Magento Project reference >>>
https://magento.stackexchange.com/questions/49000/magento-2-is-there-a-profiler
Be sure to back up before the above procedures ...
Since I don't know the correct version of your current Magento, I looked for alternatives to fix.
I hope it helps you ...
Good luck! Send news about your progress ...

gRPC and XAMPP not working

For a project I want to test the new database from Firebase, Firestore with PHP. But before i can use it, I need a couple of tools. I am trying for a day now to get it work, but no success.
I'm stuck on gRPC. I installed is, and it's working on my Mac and I can install Firestore with Composer, but I can't get it to work with XAMPP.
When I load a page I get
Fatal error: Uncaught Google\Cloud\Core\Exception\GoogleException: The requested client requires the gRPC extension.
Please see https://cloud.google.com/php/grpc for installation instructions. in /vendor/google/cloud-core/src/ClientTrait.php:75 Stack trace: #0 /vendor/google/cloud-firestore/src/FirestoreClient.php(115): Google\Cloud\Firestore\FirestoreClient->requireGrpc() #1 /app/firebase.php(18): Google\Cloud\Firestore\FirestoreClient->__construct() #2 /app/firebase.php(21): App\initialize() #3 /template.php(688): require_once('/Applications/X...') #4 /template.php(647): load_template('/Applications/X...', true) #5 /App in /vendor/google/cloud-core/src/ClientTrait.php on line 75
I added extension=grpc.so to the php.ini that is loaded by XAMPP.
But no success.
Try to use DLL file, download from here https://pecl.php.net/package/gRPC
Open your php.ini file and uncomment the line extension_dir="ext",
add extension="grpc".
Then go to the environment variables in the properties, choose path in the system variables and add the php path you are using.
I am using C:\xampp\php that's where all the magic will happen it's been a tag of war.

PEAR on PHP 7.2 on Windows 10

On a clean Windows installation I installed PHP 7.2 with Nginx which works fine, both via Nginx as on the commandline. Now, I also want to install PEAR but that will output som PHP errors which don't fully know why the happen.
Bellow the full output of the command php .\go-pear.phar which I got from the official documentation page http://pear.php.net/manual/en/installation.getting.php.
Name of configuration file [C:\WINDOWS\pear.ini] : $prefix
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation base ($prefix) : C:\tools\php
2. Temporary directory for processing : C:\tools\php\tmp
3. Temporary directory for downloads : C:\tools\php\tmp
4. Binaries directory : C:\tools\php
5. PHP code directory ($php_dir) : C:\tools\php\pear
6. Documentation directory : C:\tools\php\docs
7. Data directory : C:\tools\php\data
8. User-modifiable configuration files directory : C:\tools\php\cfg
9. Public Web Files directory : C:\tools\php\www
10. System manual pages directory : C:\tools\php\man
11. Tests directory : C:\tools\php\tests
12. Name of configuration file : C:\tools\php
13. Path to CLI php.exe : C:\tools\php
1-13, 'all' or Enter to continue:
Beginning install...
PHP Fatal error: Uncaught Error: Call to undefined method PEAR_Error::set() in phar://C:/tools/php/go-pear.phar/PEAR/Start.php:322
Stack trace:
#0 phar://C:/tools/php/go-pear.phar/PEAR/Start/CLI.php(72): PEAR_Start->doInstall()
#1 phar://C:/tools/php/go-pear.phar/index.php(5): PEAR_Start_CLI->run()
#2 C:\tools\php\go-pear.phar(1271): require_once('phar://C:/tools...')
#3 {main}
thrown in phar://C:/tools/php/go-pear.phar/PEAR/Start.php on line 322
Fatal error: Uncaught Error: Call to undefined method PEAR_Error::set() in phar://C:/tools/php/go-pear.phar/PEAR/Start.php:322
Stack trace:
#0 phar://C:/tools/php/go-pear.phar/PEAR/Start/CLI.php(72): PEAR_Start->doInstall()
#1 phar://C:/tools/php/go-pear.phar/index.php(5): PEAR_Start_CLI->run()
#2 C:\tools\php\go-pear.phar(1271): require_once('phar://C:/tools...')
#3 {main}
thrown in phar://C:/tools/php/go-pear.phar/PEAR/Start.php on line 322
The answer is actually on a page of the documentation:
https://pear.php.net/manual/en/installation.php
Windows 7 will not allow the installation script to write to c:\windows\pear.ini. It gives the "Fatal error: Call to undefined method PEAR_Error::set()" error. Change the location of the configuration files (#11) to someplace writable, complete the installation, then copy the contents into c:\windows\pear.ini.
A simple solution to this is: Run cmd as administrator.

composer command not work - PHP Warning: Phar::mapPhar

I cannot run the composer command. I'm using windows cmd.
Inside C:\ProgramData\ComposerSetup\bin, I can do php composer.phar and it works.
But if do composer or composer.bat, I get this :
PHP Warning: Phar::mapPhar(/cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar): failed to open stream: No such file or directory in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar on line 23
PHP Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "/cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar"' in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar:23
Stack trace:
#0 /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar on line 23
What's wrong ?
I'm using the cygwin php in my path (cygwin/bin).
It works if I use a new php installation. But I want to keep "cygwin/bin" in my path.
I found it !
Removing "c:\cygwin64\bin" in the path.
Adding new php installation in path : "c:\php"
Adding new system variable : "CYGWIN_HOME", with value c:\cygwin64.
This way, using windows cmd, composer will use the php in the path ("c:\php").
And using cygwin, composer will use the php in "cygwin\bin" (because of the CYGWIN_HOME variable).

Categories