I'm trying to (temporarily) ignore some errors about not using Nonces. I've tried using // #codingStandardsIgnoreLine. before the line, and I've tried using // phpcs:ignore WordPress.Security.NonceVerification.Missing., I'm still being notified of a nonce problem:
What have I done wrong? I'm using VSCode. I have PHPCS installed using composer, and the PHPCS (and -BF) extensions installed.
Did you add /Users/your-username/.composer/vendor/bin/phpcs as part of the installation? I had a similar issue because I had added another username.
Also, make sure that the following line is at the root of your project in a terminal:
composer require --dev squizlabs/php_codesniffer
To ignore the line, you can alternatively type
// phpcs:disable and // phpcs:enable at the beginning and end of the line.
I am attempting to get the volar vue language server to work in place of vetur for neovim's native lsp.
Using both lspconfig and lspinstall I was able to create a working custom install for sumneko_lua (unrelated but had to manually build due to some issues with the built-in :LspInstall lua). Below is that code duplicated and modified for an attempt at using this new vue server:
local vue_config = require'lspinstall/util'.extract_config('vuels')
vue_config.default_config.cmd = {'node', './node_modules/vscode-vue-languageservice/out/index.js', '--stdio'}
require'lspinstall/servers'.newvue = vim.tbl_extend('error', vue_config, {
install_script = [[
! test -f package.json && npm init -y --scope=lspinstall || true
npm install vscode-vue-languageservice#latest
]],
uninstall_script = nil
})
Running :LspInstall newvue installs properly, however :LspInfo shows this language server is attached to the buffer (of a .vue file) but not active. I believe the issue is with this path: ./node_modules/vscode-vue-languageservice/out/index.js. It exists, but may not be the correct entry point? The default vue ls simply has vls as the command because it provides a binary. Am I missing something in this package? I have yet to come across another language server without a single binary to pick out.
Thanks!
Can you try an absolute path to the out.js file? In my pretty elaborate config for a custom Volar install I'm using something just /home/myuser/dev/volar/packages/server/out/index.js (where the volar folder is just the whole volar cloned github repo). My full config is here
I don't think you can use relative paths like you did. I know you're assuming that the "./node_modules" means "workspace directory" but it's hard to tell in which directory nvim-lspconfig opens up those executables.
I have yet to come across another language server without a single binary to pick out.
Volar also provides a binary, it's volar-server (after running npm i -g #volar/server), it's just with a custom install (ie. alongside the real volar) you can't use it, because I assume you want to use your local install with custom code.
As for more indepth debugging/logging, you can check ~/.cache/nvim/lsp.log to see why the language server dies in detail.
This problem only happens with Laravel 5.8 on my shared hosting.
It is working fine in my shared hosting with Laravel 5.7.
It is working fine in my local environment with Laravel 5.8.
the problem is:
every time I run php artisan commands (on my shared hosting with Laravel 5.8 only) I got this error
The environment file is invalid! Failed to parse dotenv file due to an invalid name.
Failed at [APP_NAME].
my .env first line is : APP_NAME=rased
Also my site after updating to Laravel 5.8 is becoming a white blank page!
This is a general error related to parsing the .env file.
You'll see this is indicated in the error e.g.
The environment file is invalid!
Failed to parse dotenv file due to unexpected whitespace.
Failed at [This will fail].
In this example it was caused by having unescaped whitespace in the APP_NAME field i.e.
APP_NAME=This will fail
To fix, escape with quotes e.g.
APP_NAME="This is better"
This is general Error when we change our app name. To remove this error just do this.
APP_NAME=My Project Name
to this
APP_NAME="My Project Name"
You just need to add "" course around name.
Thanks
I found the cause of this problem.
It was because of line separator in .env file !
It must be CRLF not LF
My .env file was LF
see the screenshot to understand the solution
I received a similar error while upgrading from Laravel 5.5 to Laravel 5.8.
The environment file is invalid! Failed to parse dotenv file due to an
invalid name. Failed at [//APP_ENV].
5.5 would accept C style comments on APP_ENV:
// env file setup for production environment
//APP_ENV = production
//APP_DEBUG = false
// env file setup for local environment
APP_ENV = local
APP_DEBUG = true
While 5.8 will not. # works for comments:
# env file setup for production environment
#APP_ENV = production
#APP_DEBUG = false
# env file setup for local environment
APP_ENV=local
APP_DEBUG=true
I had tried removing the spaces as a brand new 5.8 application installs without spaces in these definitions. That didn't fix it.
Curiously I still have C style comments other places in the file, so only for APP_ENV?
I changed the encoding of .env and it was solved.
UFT-8 without BOM
Thanks
I recently ran into this same problem on my app for Laravel 6.12.0.
I was able to resolve this issue by adding a blank new line/space at the top of the .env file.
Example .env file:
[add a new line here]
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
I had exactly the same problem, but a different solution. CRLF made no difference.
This was driving me nuts, and I read somewhere that C style comments were no longer supported. My env file didn't contain any, but in desperation I added the following line to the top of the file:
# getting tiresome.
I don't think the wording is important, but the key thing was there was a comment.
After that, it worked. I don't know why, but it did.
Fast forward a few months, and the problem returned the next time I have to upgrade Laravel. This was kind of weird as the file was the same. This time I had to make sure I saved the file as UTF-8 without BOM.
I have added course "" around the DB_DATABASE path.
MAIL_FROM_NAME=Account confirmation
i was just making spaces between the two words
Just try to avoid it like : Account_confirmation
MAIL_FROM_NAME=Account_confirmation (correct)
In my case, I had an extra line that shouldn't be there.
Header set X-Frame-Options SAMEORIGIN Removed this and IT WORKED
I discover that if you declare the APP_NAME in quotes in the .env file, It will allow spaces in the app name but make sure you restart the server using the command (php artisan serve)
For e.g: APP_NAME='Laravel Login'
That works for me.
delete the .env file and recreate another with the same content
In case anybody else gets here and hasn't solved their problem. I came across this issue and found that it was due to using a hyphen to separate the environment variable name.
NOM-OPEN="2020/01/24"
This was okay up to Laravel 5.7 but fell over for 5.8. To solve it change the hyphen to an underscore.
NOM_OPEN="2020/01/24"
Don't forget to update all references to the variable!
Good Evening. Please i'm using Symfony 4 to create an API. I've installed the FOSRESTBUNDLE but i don't see where i can modify the configuration file of this bundle. Please i'll like to set a configuration like
fos_rest:
view:
#…
view_response_listener: true
In Symfony 2, we do it in app/config/config.yml. Please Where will i do this in Symfony 4?
Look at this article: https://codereviewvideos.com/course/beginners-guide-back-end-json-api-front-end-2018/video/setup-symfony-4-fosrestbundle
Check if you required this bundle with following command:
composer require friendsofsymfony/rest-bundle
If you require it with this command but you still don't see file config/packages/fos_rest.yaml execute following command
composer fix-recipes
If you still don't see this config file, you can just copy-paste it from original recipe repository: https://github.com/symfony/recipes-contrib/tree/master/friendsofsymfony/rest-bundle/2.2/config/packages
Also check that this bundle is included in config/bundles.php
When setting advanced properties on a program/link to start as another user it is throwing the error:
Sorry - Plasma
KDEInit could not launch 'kdesu':
Could not open library 'libkdeinit5_kdesu'.
Cannot load library /run/current-system/sw/lib/libkdeinit5_kdesu: (/run/current-system/sw/lib/libkdeinit5_kdesu.so: cannot open shared object file: No such file or directory)
I tried to install kdesu using:
[root#nixos:~]# nix-env -qaP kdesu
nixos.kdeFrameworks.kdesu kdesu-5.36.0
[root#nixos:~]# nix-env -iA nixos.kdeFrameworks.kdesu
replacing old ‘kdesu-5.36.0’
installing ‘kdesu-5.36.0’
building path(s) ‘/nix/store/2bn27h5drw0800gk5z2rmwfx78gqbbdc-user-environment’
created 2209 symlinks in user environment
[root#nixos:~]# kdesu
bash: kdesu: command not found
[root#nixos:~]# which kdesu
which: no kdesu in (/root/bin:/run/wrappers/bin:/etc/per-user-pkgs/root/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin)
I also tried installing nix-env -iA nixos.kde-cli-tools but that does not work either.
Any suggestions on how to get kdesu installed on NixOS?
As a general rule, unlike many distros on NixOS installing a library directly doesn't work as intended; the application that needs the library won't be able to find it. Instead, the package must declare all it's dependencies.
Packages which have optional dependencies tend to have a way to add them via configuration. You may want to try something like this in /etc/nixos/configuration.nix
services.xserver.desktopManager.plasma5.extraPackages = with kdeFrameworks;
[ kdesu
];
I'm glad to see that you filed an issue on Nixpkgs, because this is not a configuration issue but a packaging bug.
It looks like kdesu lives in some libexec dir that doesn't hasn't been added to your PATH. It belongs to the kde-cli-tools package. You can run it with
$(nix-build '<nixpkgs>' -A kde-cli-tools --no-out-link)/lib/libexec/kf5/kdesu
You can use the above as an alias to launch kdesu until the fix to the packaging bug arrives.