How to add new apps folder in Yii2 advanced - php

I start install Yii 2 with yii-advanced-app-2.0.11.tgz archive. After unpacking and init, i have run successful Yii 2 advanced. In folder project, i see backend and frontend application.
Now, i wanna create clinic application is here. Yii 2 can do it?. I search google, but can't find solution.
backend & frontend
clinic (How can do it?)
and then I copy frontend directories and name it "clinic" then replace all words "frontend" to "clinic". but I get error like this:
An Error occurred while handling another error:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\ErrorHandler.php(95): yii\base\Module->runAction('site/error')
#1 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "".' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction('', Array)
#1 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 R:\xampp-1-8\htdocs\berobat.id\klinik\web\index.php(17): yii\base\Application->run()
#3 {main}
Next exception 'yii\web\NotFoundHttpException' with message 'Page not found.' in R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\web\Application.php:114
Stack trace:
#0 R:\xampp-1-8\htdocs\berobat.id\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 R:\xampp-1-8\htdocs\berobat.id\klinik\web\index.php(17): yii\base\Application->run()
#2 {main}
in my perception, this is about setting config namespaceController="clinic/controllers", when I change it to "frontend/controller" this error exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' not showing anymore, but you know, if still in this config, my clinic apps will load frontend controller. So what should I do? Help me please!. Thanks so much!.

Add your clinic alias in common/config/bootstrap.php file like below and update all frontend namespaces in your clinic folder with newly added alias word.
Yii::setAlias('#clinic', dirname(dirname(__DIR__)).'/clinic');

Related

Installation failed: Destination folder already exists

Hi I was working on Wordpress and notification popped up regarding Woocomerce update, I click on it but i dont know how it failed and then woocomerce isnt showing on my plugins , nor on side bar of my wp admin panel. On my site the error coming up is
Fatal error: Uncaught Error: Call to undefined function is_product()
in
/home/homesnoo/clifsauce.com/wp/wp-content/plugins/woo-variation-swatches/woo-variation-swatches.php:314 Stack trace: #0
/home/homesnoo/clifsauce.com/wp/wp-includes/class-wp-hook.php(286): Woo_Variation_Swatches->enqueue_scripts('') #1
/home/homesnoo/clifsauce.com/wp/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2
/home/homesnoo/clifsauce.com/wp/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3
/home/homesnoo/clifsauce.com/wp/wp-includes/script-loader.php(2231): do_action('wp_enqueue_scri...') #4
/home/homesnoo/clifsauce.com/wp/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts('') #5
/home/homesnoo/clifsauce.com/wp/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6
/home/homesnoo/clifsauce.com/wp/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7
/home/homesnoo/clifsauce.com/wp/wp-includes/general-template.php(2614): do_action('wp_head') #8 /home/homesnoo/clifsauce.com/wp/wp-conten in
/home/homesnoo/clifsauce.com/wp/wp-content/plugins/woo-variation-swatches/woo-variation-swatches.php on line 314
and i hosted this site from Hosterpk. kindly help.
You can connect with your wordpress site using FTP. then move to /home/homesnoo/clifsauce.com/wp/wp-content/plugins/ and rename woo-variation-swatches to woo-variation-swatches-delete and try to run update once again. if FTP allows you to rename. your update will work.

How do I stop the "Class log cannot be found" error from occurring in laravel?

I just moved my website to a separate server in an attempt to make sure that when I push the site to the production server everything transitions smoothly. Unfortunately, the site appears blank when I visit the link unless I add something like "echo 'hello';" to the index.php page, nothing is being logged in the laravel storage files (even though the permissions are recursively set to 777), and I get this error:
nickstaging#ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
I cannot, for the life of me, figure out why it's occurring. It is recorded in the apache log file on the server. The site still runs correctly on my local homestead vm that I have running for general testing, and I tried reuploading all of the files to the server but nothing has worked.
If anyone has any idea why this is occurring, that would be great and I would very much appreciate it! Thanks in advance!
Edit
Installing php-mysql did not fix the problem and there was no difference in the error afterwards.
The most common problem is either you have spaces in your .env file or a wrong value in one of your config files.
More info here:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist

hybridauth - codeigniter - php - fetal error on redirect url

i am using HybridAuth library for social logins.
everything is working perfectly on localhost.
and it was working on my hosting server too but now i am getting this errors suddenly:
when i tried with google:
Fatal error: Uncaught exception 'Exception' with message 'User profile
request failed! Google returned an error: exception 'Exception' with
message 'The Authorization Service has return: ' in
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php:82
Stack trace: #0
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Provider_Model_OAuth2.php(114):
OAuth2Client->authenticate('4/P-5SuqvrU0DDy...') #1
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Endpoint.php(175): Hybrid_Provider_Model_OAuth2->loginFinish() #2
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Endpoint.php(56):
Hybrid_Endpoint::processAuthDone() #3
/home/moviesaints/public_html/dev/application/third_party/hybridauth/index.php(15):
Hybrid_Endpoint::process() #4
/home/moviesaints/public_html/dev/application/controllers/user/hauth.php(298):
require_once('/home/moviesain...') #5 [internal function]:
HAuth->endpoint() #6 /home/mov in
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Auth.php
on line 147
and when tried with facebook:
Fatal error: Uncaught exception 'Exception' with message
'Authentication failed! Facebook returned an invalid user id.' in
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Providers/Facebook.php:91
Stack trace: #0
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Endpoint.php(175): Hybrid_Providers_Facebook->loginFinish() #1
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Endpoint.php(56):
Hybrid_Endpoint::processAuthDone() #2
/home/moviesaints/public_html/dev/application/third_party/hybridauth/index.php(15):
Hybrid_Endpoint::process() #3
/home/moviesaints/public_html/dev/application/controllers/user/hauth.php(298):
require_once('/home/moviesain...') #4 [internal function]:
HAuth->endpoint() #5
/home/moviesaints/public_html/dev/system/core/CodeIgniter.php(359):
call_user_func_array(Array, Array) #6
/home/moviesaints/public_html/dev/index.php(202):
require_once('/home/moviesain...') #7 {main} Next exception
'Exception' with message 'Authentic in
/home/moviesaints/public_html/dev/application/third_party/hybridauth/Hybrid/Auth.php
on line 147
I have tried following solutions but still facing the same problem:
hybridauth-php-facebook-returned-an-invalid-user-id
hybridauth-facebook-returned-an-invalid-user-id
laravel4-hybridauth-facebook-authentication-failed-facebook-returned-an-invalid
Github Solution
Google group Solution
Help please, It will be appreciated.
I'm not sure this is true or not but after I was able to get my installation working I still could not get Facebook to work, no matter how hard I tried. My guess is that the SDK files used by Hybridauth for Facebook are deprecated. Facebook released new versions and quite a reworked SDK recently. That could be why there seem to be a lot of people suffering from issues with the Facebook provider right now.

dmcloud (daily motion) CloudKey_RPCException being thrown on prod environment on upload

The error below only occurs when I upload my code to the server. When I'm on my local development environment works perfectly. My local is Windows and my Production is Linux.
What does this mean? What should I do to solve it?
Fatal error: Uncaught exception 'CloudKey_RPCException' with message 'You must provide an url for mp4_h264_aac' in /var/www/application/libraries/CloudKey.php:336 Stack trace: #0 /var/www/application/libraries/VideoUploader.php(56): CloudKey_Api->__call('create', Array) #1 /var/www/application/libraries/VideoUploader.php(56): CloudKey_Media->create(Array) #2 /var/www/application/controllers/Admin.php(519): VideoUploader->upload(Array, Array, '06d88cc1721cbe1...') #3 [internal function]: Admin->videos('upload') #4 /var/www/system/core/CodeIgniter.php(356): call_user_func_array(Array, Array) #5 /var/www/public/index.php(274): require_once('/var/www/system...') #6 {main} thrown in /var/www/application/libraries/CloudKey.php on line 336
Ok, in case anyone ever needs this. The problem is that, I was using the $_FILES['file']['tmp_name'] directly into DMCloud method. Turns out that on Windows, it's something like C:\temp\file.tmp and on linux is something like /tmp/file. DMCloud api requires that the file used for upload must have an extension.
So, it failed to upload the file, and when I tried to use the URL of the failed upload, it gaveme this exception.
I hope someone fin this hopeful in the future =)

Issue in phpuit ServiceManager::get was unable to fetch or create an instance for ModuleManager

I am following this guide http://devblog.x2k.co.uk/getting-the-servicemanager-into-the-test-environment-and-dependency-injection/ to get my phpunit stuff to run.
But after i add this code AS PER according to the tutorial .
$serviceManager->get('ModuleManager')->loadModules();
i get the following error where could not find any clue to resolve !
`PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for ModuleManager' in /home/dan/www/d2zfcuser/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:518
Stack trace:
#0 /home/dan/www/d2zfcuser/tests/Bootstrap.php(23): Zend\ServiceManager\ServiceManager->get('ModuleManager')
#1 /home/dan/www/d2zfcuser/tests/Bootstrap.php(32): Bootstrap::init()
#2 /usr/share/php/PHPUnit/Util/Fileloader.php(95): include_once('/home/dan/www/d...')
#3 /usr/share/php/PHPUnit/Util/Fileloader.php(79): PHPUnit_Util_Fileloader::load('/home/dan/www/d...')
#4 /usr/share/php/PHPUnit/TextUI/Command.php(867): PHPUnit_Util_Fileloader::checkAndLoad('/home/dan/www/d...')
#5 /usr/share/php/PHPUnit/TextUI/Command.php(620): PHPUnit_TextUI_Command->handleBootstrap('/home/dan/www/d...')
#6 /usr/share/php/PHPUnit/TextUI/Command.php(139): PHPUnit_TextUI_Command->handleArguments(Array)
#7 /usr/share/php in /home/dan/www/d2zfcuser/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 518`
Please Help me to resolve this issue.
This issue was resolved after using the Bootstrap provided here.
So Bootstrap used in the above tutorial is the issue behind this problem. finally its solved.

Categories