I installed an Oauth library for social media login in my demo project and it worked smoothly. After that i moved same code to my main project and got this error:
Call to undefined method Config::get()
at this line in routes.php
$config = \Config::get('socialogin::config');
I have already run composer update and published configurations of the installed library/package.
Please help me. Above code worked in demo project but not working in my main project. Both projects have same version i.e. 4.2.16
Thanks
This line did the trick
use Illuminate\Support\Facades\Config;
I added above line at top of routes.php and it worked just fine.
Related
I have few controllers in my zf2 project which work perfectly in the browser using apache and via command line.
However, I recently installed MongoDb so I can store some data using the driver found in (http://php.net/manual/en/set.mongodb.php)
My issue is, when I try to access the driver via controller + browser, I get the following message error in my apache logs :
PHP Fatal error: Class 'MongoDb\Driver\Manager' not found.
'MongoDb\Driver\Manager' is the namespace for this Driver.
If I execute some other controllers via command line, MongoDb works correctly.
Does anyone know why is this happening? I cannot see the issue :(
Thank you
I found that my php.ini was pointing to mongo.so instead of mongodb.so
That fixed the issue
http://php.net/manual/en/mongodb.installation.manual.php
Thank you for your help
i wonder why i'm get something like this when add pingpong sky module to project
i think, i already follow all instruction in pingpong sky installation
when i create module Auth in cmd i got message success
but when i try to access Auth module in browser by this url
http://localhost/skypp/public/auth
i got message error
FatalErrorException in Application.php line 575:
Class 'Modules\Auth\Providers\AuthServiceProvider' not found
i think some problem occur when create that module
so i tried again make new module,
but it's failed this time like in pict
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Modules\Auth\Providers\AuthServiceProvider' not found
where i'm missing?
It's actually quite simple and I don't know why the module:make command doesn't integrate it...
Please run a composer dump-autoload so that it rescans the PSR-4 folder and you should be good to go :)
I've developed a small project on a machine, using CakePHP 3.0, and I need it to run on another machine. I've tried to install it on several other machines.
If I run the composer to install the CakePHP 3.0, then I copy my stuff to overwrite it, the project works. I've tried this on two machines and had no problem so far. If I don't run the composer, and just copy the stuff to the target machine, it gives me the following error. I've tried this on 3 machines, and every machine gives me this:
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
I've copied the whole project to this server to test.
I told you this because I thought it has something to do with my problem. The point is that I have to run this on a machine that is not mine, and I can't install composer on it. The /public_html/vendor/cakephp/cakephp/src/I18n/ has files related to internationalization and localization, but my project will never be translated, so a workaround to make the project ignore those files would be enough to solve my problem.
The following code is an excerpt from the (...)/I18n/I18n.php that might be relevant:
<?php
namespace Cake\I18n;
use Aura\Intl\FormatterLocator;
use Aura\Intl\PackageLocator;
use Aura\Intl\TranslatorFactory;
use Cake\I18n\Formatter\IcuFormatter;
use Cake\I18n\Formatter\SprintfFormatter;
use Locale;
class I18n {
// lots of code here
public static function defaultLocale() {
if (static::$_defaultLocale === null) {
static::$_defaultLocale = Locale::getDefault() ?: 'en_US';
// the line above is the Line 229
}
return static::$_defaultLocale;
}
// many code here too
}
I've checked that another file also tries to access this Locale class, but I don't know if there are other files trying to access it as well. Many files from everywhere inside the project tries to access methods from I18n.php. I need it running but I can't figure out how to make it run.
Any help will be greatly appreciated.
As I just found out, prior to CakePHP 3.0, the installation must be done by composer, as stated in the 3.0 migration guide:
CakePHP should be installed with Composer
Since CakePHP can no longer easily be installed via PEAR, or in a shared
directory, those options are no longer supported. Instead you should use
Composer to install CakePHP into your application.
So it won't run on regular free web hosting services.
I am a Kohana newbie who is currently stuck with the installation process.
I have downloaded the latest version(3.3.1) of kohana and installed it in my php server. The kohana installation asked to me to delete the install.php as it found that my server is well equipped to run kohana based applications.
I have renamed the install.php. and used the following url to get kohana homepage. www.mydomain.com/kohana, kohana is where i uploaded the kohana files.
When i tried running above URL it ended up an error asking to me to add Cookie::$Salt statement to the bootstrap.php. I addded the line Cookie::$Salt ="foobar" somewhere below Line 90 of bootstrap.php. Now i am getting the following error.
Fatal error: Access to undeclared static property: Cookie::$Salt on
line 91
Kindly advice how to resolve this issue.
Static properties are case sensitive in PHP! You need to set $salt, not $Salt.
Cookie::$salt = "...";
I have installed pdliwa PHPPdf in my Symfony2, I was testing the examples in the route \vendor\psliwa\php-pdf\examples and all worked fine except one.
The one that isnt working is barcode.xml. When I try to test it this error msg appear:
FatalErrorException: Error: Class 'Zend\Barcode\Object\Code128' not found in
C:\xampp\htdocs\Symfony\vendor\psliwa\php-pdf\lib\PHPPdf\Core\Node\Barcode.php line 175
I have zendframework in my vendor folder.
Anyone knows whats the problem?
You have to update your composer.json file, adding zend-barcode and zend-validator (which is required by zend-barcode). Then it works.