PHP Fatal error: Class 'sfContext' not found - php

hi I'm using php/symfony ( symfony 1.0 ) and im getting following exception at the very first page
PHP Fatal error: Class 'sfContext' not found
I tried symfony cc at the root and its working but error is still there ,
may be its due to failure in autoloading files and following line from the code gives me the exception
$customerName = sfContext::getInstance()->getUser()->getAttribute('meta.customerName');
I'm assuming it might be a symfony exception

Sorry for the less information , actually I was installing a web based application and thats all printed in the log , anyhow I managed to find the fault with adding some var_dumps on the flow methods ,
missing php-mysqli extension caused the problem and unfortunately it's not handled from the application level so only a symfony level single line exception printed.

Here is the stack trace :
PHP Fatal error: Uncaught Error: Class 'sfContext' not found in /usr/local/rms/evt/uranai/lib/symfony-1.0.11/util/sfCore.class.php:171\nStack trace:\n#0 [internal function]: sfCore::splAutoload('sfContext')\n#1 /usr/local/rms/evt/uranai/lib/symfony-1.0.11/util/sfCore.class.php(171): spl_autoload_call('sfContext')\n#2 [internal function]: sfCore::splAutoload('sfPhpConfigHand...')\n#3 /usr/local/rms/evt/uranai/cache/pc/prod/config/config_config_handlers.yml.php(7): spl_autoload_call('sfPhpConfigHand...')\n#4 /usr/local/rms/evt/uranai/lib/symfony-1.0.11/config/sfConfigCache.class.php(279): require_once('/usr/local/rms/...')\n#5 /usr/local/rms/evt/uranai/lib/symfony-1.0.11/config/sfConfigCache.class.php(60): sfConfigCache->loadConfigHandlers()\n#6 /usr/local/rms/evt/uranai/lib/symfony-1.0.11/config/sfConfigCache.class.php(190): sfConfigCache->callHandler('config/settings...', Array, '/usr/local/rms/...')\n#7 /usr/local/rms/evt/uranai/lib/symfony-1.0.11/symfony.php(87): sfConfigCache->checkConfig('config/settings...')\n#8 /usr/local/rms/evt in /usr/local/rms/evt/uranai/lib/symfony-1.0.11/util/sfCore.class.php on line 171

Related

Host doesn't recognize my psr-4 class on composer

I created a page for tests using easyphp, in easyphp the classes are loaded normally and everything works fine, but when sending the files to the hosting, the classes are no longer recognized for some reason I don't know... does anyone know how to help me?
Page: https://spetests.000webhostapp.com/gerar-qrcode-dinamico.php
Error: Fatal error: Uncaught Error: Class 'App\Pix\Api' not found in /storage/ssd4/870/19749870/public_html/gerar-qrcode-dinamico.php:12 Stack trace: #0 {main} thrown in /storage/ssd4/870/19749870/public_html/gerar-qrcode-dinamico.php on line 12
Files(from tutorial): https://github.com/william-costa/wdev-qrcode-pix-php

How to share cakephp 3.0 while using git

I recently installed git for sharing cakephp 3.0 code but after pushing and pulling the browser seems blank then I edit .gitignore file and remove all commands excluding /tem/* because I didn't worry about security right now and then I shared my code and got this error:
Fatal error: Class 'Psr\Log\AbstractLogger' not found in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php on line 24
Fatal error: Uncaught RuntimeException: Could not load class Cake\Log\Engine\FileLog in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php:57 Stack trace: #0
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(91): Cake\Log\LogEngineRegistry->_throwMissingClassError('Cake\\Log\\Engine...', NULL) #1
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(198): Cake\Core\ObjectRegistry->load('Cake\\Log\\Engine...', Array) #2
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(180): Cake\Log\Log::_loadConfig() #3
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(360): Cake\Log\Log::_init() #4
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(284): Cake\Log\Log::write(3, 'Fatal Error (1)...') #5
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(216): Cake\Error\BaseErrorHandler->_logError(3, Array) #6
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/Bas in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php on line 57
I m posting answer for my question, actually its a permission issue in Linux and therefore it doesn't allow to share all the file while using push command in git but while using it doesn't show any error but it doesn't work properly on other end.

Could not find a valid ServiceManager for RoutePluginManager

When I try to run zend program its shows error as follows
PHP Fatal error: Uncaught exception
'Zend\ModuleManager\Listener\Exception\RuntimeException' with message
'Could not find a valid ServiceManager for RoutePluginManager' in
/Documents/zf2-example-login/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php:202
Stack trace:
#0 /Documents/zf2-example-login/vendor/zendframework/zend-eventmanager/src/EventManager.php(271):
Zend\ModuleManager\Listener\ServiceListener-onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#1 /Documents/zf2-example-login/vendor/zendframework/zend-eventmanager/src/EventManager.php(143):
Zend\EventManager\EventManager-triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 /Documents/zf2-example-login/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(129):
Zend\EventManager\EventManager-triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 /Documents/zf2-example-login/vendor/zendframework/zend-mvc/src/Application.php(264): Zend\ModuleManager\ModuleManager-> in
/Documents/zf2-example-login/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php
on line 202
I'm newbie to zend, I tried googling but unable to find the solution.Help me.
Found a clue here:
https://github.com/zendframework/zend-modulemanager/issues/42
You first need to check to see if you have ZF3 installed. One quick way to check is to look under "vendor/zendframework" and see if you have a subdirectory "zend-router".
If so, add this to your application.config.php file under the "modules" key:
'Zend\Router'

Fatal error because an Error instance is being passed instead of an expected Exception instance

I just installed xampp with php 7.0.4 and a fresh cakephp 3.2.6.
I did a lot of research and everything I found shows that they are compatible.
However as soon as I go to open the application with a browser, cake replies with an Internal Error.
The only pointer as to what to do is that xampp logs the following in apache error.log:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Cake\Error\BaseErrorHandler::handleException() must be an instance of Exception, instance of Error given in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:153
Stack trace:
#0 [internal function]: Cake\Error\BaseErrorHandler->handleException(Object(Error))
#1 {main} thrown in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php on line 153
I tried php 5.6 but it still shows the error in the log.
If that's the error that you are encountering, then I'd doubt that you are using CakePHP 3.2.6, as line 153 is in the middle of a comment
https://github.com/cakephp/cakephp/blob/3.2.6/src/Error/BaseErrorHandler.php#L153
PHP7 errors are handled since CakePHP 3.1.5, so check your CakePHP dependency, and make sure it's actually up to date.

Getting 500 Internal Server Error with Stripe

I am trying to implement basic functionality of the Stripe API, I get 500 Internal Server Error for some reason when I require the Stripe.php file that you have to require...When I comment the require out the error goes away but obviously I can not use the API then..
Basic require...shows error in the Modal Log
require_once('/php/Stripe.php');
I checked the server error and it gave me this back
Fatal error: Uncaught exception 'Exception' with message 'Stripe needs the Multibyte String PHP extension.' in /php/Stripe.php:13 Stack trace: #0 /home/stripepost.php(4): require_once() #1 {main} thrown in /php/Stripe.php on line 13
This all comes from just requiring the file..
Is your 'Stripe.php' file really located in '/php' or is it in a folder called 'php' local to your code?
Current code:
require_once('/php/Stripe.php');
I think the problem is this. You probably mean to use something relative to your code base. Like this:
require_once('./php/Stripe.php');
I found out the answer I didn't have the mbstring enabled on my server...whooops

Categories