YII2 : kartik Select2 - yii2

i have worked on project in advanced yii2 , it works fine in localhost but after i upload it there is a message appear that says :
Class 'kartik\select2\select2' not found
the weird thing is : select2 works fine in localhost and i upload all the files

Your solution could be:
use kartik\select2\Select2;
Maybe you are using Windows on localhost and Linux on the remote server.

I assume, that you didn't something like "download to localhost kartik select2, then just copy&paste /vendor/kartik-v/yii2-widget-select2 to server. I hope. Because you shouldn't do like that.
Add this line to require section in project-directory/composer.json file
"kartik-v/yii2-widget-select2": "#dev"
Then run in project directory command:
composer update

If you don't have access to a command line interface in your server to run the composer update command, you need to upload the folder "vendor/composer/" and the "vendor/autoload.php" file to your web server.

When moving your code to production, you have to install all libraries used by composer with
composer install
or
php composer.phar install
Then the same versions of libraries get installed as on your dev site where you tested the application.
This is the reason why in .gitignore the file composer.lock is NOT included: Just to ensure the same lib versions on dev and prod sites.

Related

How to correct install and use plugin installed via composer

I installed a cakephp 3 app via composer from the root of my website c:wamp/www/my_app, and I developed untill i need to implement acl.
I installed the acl plugin for cakephp 3 via composer for the same path c:/wamp/www/myapp and i configured it, was everything well, but when i test the implementation of acl, i get the following error:
Missing Component, Create the class AclComponent below in file: src\Controller\Component\AclComponent.php
and seems to be true, theres no such file in the above location, instead the file is in vendor/cakephp/acl/src/controller/component.
Was investigating and i find that composer doesnt install plugins in a cake default path, theres many articles about, but how doi correct my installation? I already did all the stuff to implement the access control lists.
Thanks in advance error screenshot

Install Laravel 5 on Openshift - gives blank page

I installed Laravel 5 on Openshift via Git. Hitting my app (the clean install) in a browser returns a blank page. Any idea what could be the cause?
Here is the URL: http://dev-rogercreasy.rhcloud.com/
Looks like you have old composer. I had the same error. To fix it go to your php dir and update composer.
In my case I gone to folder where placed my php.exe and ran command composer self-update:
cd d:\work\OpenServer\modules\php\PHP-5.5>D:\work\OpenServer\modules\php\PHP-5.5\
composer self-update
After it I gone back to folder with project and composer install command completed without any errors.
Check out the Laravel 5 QuickStart. The QuickStart uses a custom version of the standard OpenShift PHP 5.4 cartridge. The only difference is the included version of Composer has been updated.

Apache output web page(layout) not properly

I install Apache on CentOS 7,
sudo yum install httpd
then copy this webpage template to /var/www/html/
when I browse /var/www/html/index.html, I got this:
But I browse 127.0.0.1, I got this:
I tried on Chrome and IE, get the same output. The develop console output is the same.
Is my apache missing something ?
I think that your CSS or script paths are not correct/accessible (as long as this site does not require working PHP interpreter)...
Check what happens when you enter the address of CSS/Scripts location.

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).

Problems in getting SublimeLinter to work

I need help getting the SublimeLinter to work.
I have installed the SublimeLinter using the package installer. However I cant see the lint working in my js files. Also when I do command + shift + P (linux) I only see the following command for linter 'Sublime Linter : Extract Annotations'.
I don't see the other commands for running the linter.
Any Ideas what is wrong?
Thanks,
Murtaza
You have to install nodejs from the repos.
If nodejs isn't installed in /usr/local/bin/node you have to set a symbolic link to this place:
touch /usr/local/bin/node
ln -s /usr/bin/nodejs /usr/local/bin/node
The above worked for me on debian/crunchbang
Alternatively you can change the sublime user settings for linter(ps haven't tested this option)
"sublimelinter_executable_map":
{
"javascript": "/usr/bin/nodejs"
}
Some tips:
Be sure your files are using the Javascript syntax.
The linter runs automatically (check the package settings).
Open the console to see any errors.
Check the documentation to configure Javascript linters