Phalcon\Loader\Loader not found - php

I have a newly cloned phalcon repository:
software: MacOS
Phalcon: 5.0.0RC4
PHP: 8.1
Zephir: 0.16.0
brew: phalcon#4.1.0
Location: ~/Documents/cphalcon
I am trying to set up my new repository by following the tutorial here.
However when I go to my page at localhost:8000, this error pops up:
Fatal error: Uncaught Error: Class "Phalcon\Loader\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
I found some similar thread and they said to check my phpinfo to see if phalcon is there, and it was.
I checked for more materials but couldn't find any other clues.
I also tried changing the call to:
use Phalcon\Loader;
But it was the same
Fatal error: Uncaught Error: Class "Phalcon\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
Any clues?

I believe that in version 5 the proper syntax now is Phalcon\Autoload\Loader().
Since Phalcon 5 is still in Release Candidate mode (hence the "RC4" on the version), the docs are still lagging a bit behind.
I've converted a couple of Phalcon 3 and 4 sites, and I found the Phalcon 5.0.0RC4 ChangeLog to be helpful when moving from Phalcon 4 to 5. The move from 3 to 5 is far more involved and requires finding the Phalcon 4 update doc on the Phalcon web site.
I hope this helps.

Related

What would prevent a PHP die() from working? On my computer die() is not working

This is on MacOS with PHP 8.1.10 installed via homebrew ...
Just a blank index.php code in it with only this code ...
<?php
die('We Should Just Die Here');
throw new \RuntimeException('This exception should never be seen');
?>
And .. render in my browser to see ...
<br />
<b>Fatal error</b>: Uncaught RuntimeException: This exception should never be seen in /path/to/public/index.php:4
Stack trace:
#0 /Users/my-user/.composer/vendor/laravel/valet/server.php(234): require()
#1 {main}
thrown in <b>/path/to/public/index.php</b> on line <b>4</b><br />
Same story if I run it command line (taking valet out of the equation) ..
$ php index.php
Fatal error: Uncaught RuntimeException: This exception should never be seen in /path/to/public/index.php:4
Stack trace:
#0 {main}
thrown in /path/to/public/index.php on line 4
I have already tried ...
Upgrading PHP
Re-installed Valet
Composer updating everything
In my roughly 800 years of writing PHP code I have never seen anything like this. Please if anyone has any help I'm interested.
I've found it. I installed the php-uopz extension a while back. I had completely forgotten about that.
pecl uninstall uopz fixed this for me.
Thank you for the rubber ducking stack overflow ;P

php spark serve Codeigniter 4 not working

I installed library from endroid's github (qr-code).
When i was trying to do php spark serve, it said:
Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\CLI\Console::_
_construct() must be an instance of CodeIgniter\CodeIgniter, int given, called i
n D:\Kuliah\Magang\akses-log-data-center-itb\spark on line 49 and defined in D:\
Kuliah\Magang\akses-log-data-center-itb\vendor\codeigniter4\framework\system\CLI
\Console.php:29
Stack trace:
#0 D:\Kuliah\Magang\akses-log-data-center-itb\spark(49): CodeIgniter\CLI\Console
->__construct(1)
#1 {main}
thrown in D:\Kuliah\Magang\akses-log-data-center-itb\vendor\codeigniter4\frame
work\system\CLI\Console.php on line 29
How do i fix this?
try this
copy the index.php file in vendor/codeigniter4/framework/public/index.php (to) public/index.php
then
copy spark file in vendor/codeigniter4/framework/spark (to) root folder
from:
https://forum.codeigniter.com/printthread.php?tid=82087
Just to add to Brian's answer, I found out that the spark file was updated in version 4.2.0. If you have experienced this issue, I suggest you read its changelog to learn about other breaking changes.

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 ...

Cannot composer install with Symfony in PhpStorm

I have a problem with PhpStorm. I had trouble adding the Composer and Symfony commands to PhpStorm.
I receive a message of this style:
Problem Failed to parse output as xml: Error on line 2: Content is not
allowed in prolog.. Command php /root/Downloads/composer.phar list
--format=xml Output Fatal error: Uncaught Error: Class 'DOMDocument' not found in
phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php:90
Stack trace:
0 phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php(166):
Symfony\Component\Console\Descriptor\XmlDescriptor->getApplicationDocument(Object(Composer\Console\Application),
NULL)
1 phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/Descriptor.php(55):
Symfony\Component\Console\Descriptor\XmlDescriptor->describeApplication(Object(Composer\Console\Application),
Array)
2 phar:///root/Downloads/composer.phar/vendor/symfony/console/Helper/DescriptorHelper.php(69):
Symfony\Component\Console\Descriptor\Descriptor->describe(Object(Symfony\Component\Console\Output\ConsoleOutput),
Object(Composer\Console\Application), Array)
3 phar:///root/Downloads/composer.phar/vendor/symfony/console/Command/ListCommand.php(81):
Symfony\Component\Console\Helper\DescriptorHelper->describe(Object(Symfony\Component\Console\Ou
in
phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php
on line 90
Can you help me find the solution please ?
The version of PHP needs to be recent. On macOS by default you may end up with PHP 5.6, and PHPStorm actually choose /usr/bin/php as it's preferred option for commands.

Fatal error: Uncaught Error: Class 'mysqli' not found -- IIS- Windows 7

I got this error whenever I open my project. This project can run on my other laptop which is using XAMPP.
I want to use IIS 6.0 on my Windows 7 Pro.
I already installed IIS, Setting environment variable, remove semicolon on my php.ini-development, add handler. So confusing and still not get the right answer.
Fatal error: Uncaught Error: Class 'mysqli' not found in C:\inetpub\wwwroot\SIA-2\general\function.php:8 Stack trace: #0 C:\inetpub\wwwroot\SIA-2\general\initial.php(10): open_connection() #1 C:\inetpub\wwwroot\SIA-2\index.php(41): include_once('C:\inetpub\wwwr...') #2 {main} thrown in C:\inetpub\wwwroot\SIA-2\general\function.php on line 8
https://drive.google.com/folderview?id=0B66OIQlx1mwzc0JVbVhjX0U0aDQ&usp=sharing
please do not give me any documentation. i'm sick of it. thank you.

Categories