Cannot validate phpcs

Hello. I work with PHPStorm in windows, and PHP is in a linux VM. I have everything configured so PHPStorm executes PHP from the remote interpreter, xdebug, etc.. except for phpcs. When I click the "Validate" button it replies me with "Can not run PHP Code Sniffer", without more information to guide me in how to solve the problem. I checked the idea.log file and all I got were entries about the successful upload of the helper files.

 

 

 

 

Had to cover the paths and username from the screenshots, but the phpcs path in Phpstorm is correct. Any clue on how to solve this? Or at least get more information about what went wrong?

 

Thanks in advance..

6 comments

Try adding 

#com.jetbrains.php.tools.quality.QualityToolProcessCreator

and 

#com.intellij.php

lines to Help | Debug Log Settings..., then try validating installation again and check the idea.log.

0

Hello Dmitry. Here's the log after I updated the settings (please note that I changed the paths):

 

2019-02-21 11:54:19,930 [789028075] DEBUG - lity.QualityToolProcessCreator - Running external tool: /editted/path/to/phpcs --version
2019-02-21 11:54:20,439 [789028584] INFO - ugins.remotesdk.RemoteTransfer - Uploading helpers to /my/home/dir/.phpstorm_helpers
2019-02-21 11:54:20,487 [789028632] INFO - ugins.remotesdk.RemoteTransfer - Remote helpers version is PS-183.5429.47, local helpers version is PS-183.5429.47
2019-02-21 11:54:20,487 [789028632] INFO - ugins.remotesdk.RemoteTransfer - Helpers upload successfully completed
2019-02-21 11:54:20,487 [789028632] INFO - .diagnostic.PerformanceWatcher - Helpers uploaded took 48ms; general responsiveness: ok; EDT responsiveness: ok

 

To be sure that the path is correct, I opened an SSH session to the server using PHPStorm (Tools -> Start SSH session) and copy+pasted the phpcs --version command as is, and it replied normally with it's version: PHP_CodeSniffer version 3.4.0 (stable) by Squiz (http://www.squiz.net)

0

Thanks! Please remove #com.intellij.php and also add 

 

#com.jetbrains.php
#com.intellij.ssh
#com.jetbrains.plugins.webDeployment
#com.intellij.execution

 

Then try again & share the result.

0

2019-02-21 14:34:30,530 [798638675] DEBUG - lity.QualityToolProcessCreator - Running external tool: /path/to/phpcs --version
2019-02-21 14:34:30,540 [798638685] DEBUG - ntellij.ssh.impl.SshConnection - Failed to create SSH channel using existing SSH sessions, creating new SSH session
2019-02-21 14:34:30,540 [798638685] DEBUG - ntellij.ssh.impl.SshConnection - Establishing new SSH session to user@server:22
2019-02-21 14:34:30,561 [798638706] DEBUG - intellij.ssh.SshConnectionUtil - Setting up ssh connection to server:22 for user, with password, with keepAliveTimeout 120000, with serverAliveCountMax 1000, with timeout 0, with daemonThread false
With config StrictHostKeyChecking = no, compression.s2c = zlib,none, HashKnownHosts = no, compression.c2s = zlib,none,
2019-02-21 14:34:30,561 [798638706] DEBUG - #com.intellij.ssh - Connecting to server port 22
2019-02-21 14:34:30,574 [798638719] DEBUG - #com.intellij.ssh - Connection established
2019-02-21 14:34:30,596 [798638741] DEBUG - #com.intellij.ssh - Remote version string: SSH-2.0-OpenSSH_7.4
2019-02-21 14:34:30,596 [798638741] DEBUG - #com.intellij.ssh - Local version string: SSH-2.0-JSCH-0.1.54
2019-02-21 14:34:30,596 [798638741] DEBUG - #com.intellij.ssh - CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
2019-02-21 14:34:30,597 [798638742] DEBUG - #com.intellij.ssh - CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
2019-02-21 14:34:30,624 [798638769] DEBUG - #com.intellij.ssh - CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
2019-02-21 14:34:30,624 [798638769] DEBUG - #com.intellij.ssh - SSH_MSG_KEXINIT sent
2019-02-21 14:34:30,625 [798638770] DEBUG - #com.intellij.ssh - SSH_MSG_KEXINIT received
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: none,zlib@openssh.com
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server: none,zlib@openssh.com
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server:
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server:
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: zlib,none
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client: zlib,none
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client:
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client:
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: server->client aes128-ctr hmac-sha1 none
2019-02-21 14:34:30,626 [798638771] DEBUG - #com.intellij.ssh - kex: client->server aes128-ctr hmac-sha1 none
2019-02-21 14:34:30,630 [798638775] DEBUG - #com.intellij.ssh - SSH_MSG_KEX_ECDH_INIT sent
2019-02-21 14:34:30,630 [798638775] DEBUG - #com.intellij.ssh - expecting SSH_MSG_KEX_ECDH_REPLY
2019-02-21 14:34:30,637 [798638782] DEBUG - #com.intellij.ssh - ssh_rsa_verify: signature true
2019-02-21 14:34:30,637 [798638782] DEBUG - #com.intellij.ssh - Host 'server' is known and matches the RSA host key
2019-02-21 14:34:30,638 [798638783] DEBUG - #com.intellij.ssh - SSH_MSG_NEWKEYS sent
2019-02-21 14:34:30,638 [798638783] DEBUG - #com.intellij.ssh - SSH_MSG_NEWKEYS received
2019-02-21 14:34:30,639 [798638784] DEBUG - #com.intellij.ssh - SSH_MSG_SERVICE_REQUEST sent
2019-02-21 14:34:30,640 [798638785] DEBUG - #com.intellij.ssh - SSH_MSG_SERVICE_ACCEPT received
2019-02-21 14:34:30,695 [798638840] DEBUG - #com.intellij.ssh - Authentications that can continue: gssapi-with-mic,publickey,keyboard-interactive,password
2019-02-21 14:34:30,695 [798638840] DEBUG - #com.intellij.ssh - Next authentication method: gssapi-with-mic
2019-02-21 14:34:30,706 [798638851] DEBUG - #com.intellij.ssh - Authentications that can continue: publickey,keyboard-interactive,password
2019-02-21 14:34:30,706 [798638851] DEBUG - #com.intellij.ssh - Next authentication method: publickey
2019-02-21 14:34:30,706 [798638851] DEBUG - #com.intellij.ssh - Authentications that can continue: password
2019-02-21 14:34:30,706 [798638851] DEBUG - #com.intellij.ssh - Next authentication method: password
2019-02-21 14:34:30,863 [798639008] DEBUG - #com.intellij.ssh - Authentication succeeded (password).
2019-02-21 14:34:30,864 [798639009] DEBUG - ntellij.ssh.impl.SshConnection - SSH session @389e52d4 (@5cad1d7f) established to user@server:22
2019-02-21 14:34:30,865 [798639010] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SSH session @389e52d4 to user@server:22
2019-02-21 14:34:30,992 [798639137] INFO - ugins.remotesdk.RemoteTransfer - Uploading helpers to /home/user/.phpstorm_helpers
2019-02-21 14:34:30,994 [798639139] DEBUG - t.connections.RemoteConnection - Opening connection to sftp://server:22/ in @36300ba
2019-02-21 14:34:30,996 [798639141] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SSH session @389e52d4 to user@server:22
2019-02-21 14:34:30,999 [798639144] DEBUG - ins.plugins.webDeployment.sftp - connect(0)
2019-02-21 14:34:31,012 [798639157] DEBUG - ins.plugins.webDeployment.sftp - setFilenameEncoding("windows-1252")
2019-02-21 14:34:31,012 [798639157] WARN - ins.plugins.webDeployment.sftp - The encoding can not be changed for this sftp server.
4: The encoding can not be changed for this sftp server.
at com.jcraft.jsch.ChannelSftp.setFilenameEncoding(ChannelSftp.java:2981)
at com.jetbrains.plugins.webDeployment.config.LoggingSftpChannel.setFilenameEncoding(LoggingSftpChannel.java:353)
at com.jetbrains.plugins.webDeployment.connections.PatchedSftpFileSystem.getChannel(PatchedSftpFileSystem.java:64)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:177)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:112)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1428)
at org.apache.commons.vfs2.provider.AbstractFileObject.isFile(AbstractFileObject.java:1605)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doListChildrenResolved(SftpFileObject.java:462)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1091)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChild(AbstractFileObject.java:1044)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.lambda$createConnection$0(RemoteConnectionPool.java:260)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2019-02-21 14:34:31,013 [798639158] DEBUG - ins.plugins.webDeployment.sftp - cd "/"
2019-02-21 14:34:31,014 [798639159] DEBUG - ins.plugins.webDeployment.sftp - stat "."
2019-02-21 14:34:31,034 [798639179] DEBUG - ins.plugins.webDeployment.sftp - dr-xr-xr-x 0 0 4096 Sun Feb 10 02:35:10 GMT 2019, mtime 1,549,766,110
2019-02-21 14:34:31,035 [798639180] DEBUG - ins.plugins.webDeployment.sftp - ls "."
2019-02-21 14:34:31,040 [798639185] DEBUG - ins.plugins.webDeployment.sftp - 28 item(s):

[Listing of / path]


2019-02-21 14:34:31,040 [798639185] DEBUG - t.connections.RemoteConnection - Added connection to pool ofsftp://server:22/ in @36300ba; 1 connections exists
2019-02-21 14:34:31,044 [798639189] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SSH session @389e52d4 to user@server:22
2019-02-21 14:34:31,044 [798639189] DEBUG - ins.plugins.webDeployment.sftp - connect(0)
2019-02-21 14:34:31,059 [798639204] DEBUG - ins.plugins.webDeployment.sftp - setFilenameEncoding("windows-1252")
2019-02-21 14:34:31,059 [798639204] WARN - ins.plugins.webDeployment.sftp - The encoding can not be changed for this sftp server.
4: The encoding can not be changed for this sftp server.
at com.jcraft.jsch.ChannelSftp.setFilenameEncoding(ChannelSftp.java:2981)
at com.jetbrains.plugins.webDeployment.config.LoggingSftpChannel.setFilenameEncoding(LoggingSftpChannel.java:353)
at com.jetbrains.plugins.webDeployment.connections.PatchedSftpFileSystem.getChannel(PatchedSftpFileSystem.java:64)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:177)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:112)
at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1428)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetInputStream(SftpFileObject.java:657)
at org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1217)
at org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:263)
at com.jetbrains.plugins.webDeployment.FileTransferUtil.getContent(FileTransferUtil.java:135)
at com.jetbrains.plugins.remotesdk.RemoteTransfer.helpersUpdateNeeded(RemoteTransfer.java:252)
at com.jetbrains.plugins.remotesdk.RemoteTransfer.doCopyHelpers(RemoteTransfer.java:185)
at com.jetbrains.plugins.remotesdk.RemoteTransfer.lambda$uploadHelpers$1(RemoteTransfer.java:133)
at com.jetbrains.plugins.remotesdk.RemoteTransfer$1.run(RemoteTransfer.java:153)
at com.jetbrains.plugins.remotesdk.RemoteTransfer.uploadHelpers(RemoteTransfer.java:139)
at com.jetbrains.plugins.remotesdk.RemoteTransfer.uploadHelpers(RemoteTransfer.java:111)
at com.jetbrains.php.remote.PhpRemoteTransfer.uploadHelpers(PhpRemoteTransfer.java:213)
at com.jetbrains.php.remote.PhpRemoteTransfer.uploadHelpers(PhpRemoteTransfer.java:332)
at com.jetbrains.php.remote.PhpRemoteSshHelpersManager.update(PhpRemoteSshHelpersManager.java:62)
at com.jetbrains.php.remote.PhpRemoteSshProcessRunner.updateHelpersAndValidate(PhpRemoteSshProcessRunner.java:79)
at com.jetbrains.php.remote.PhpRemoteSshProcessRunner.getProcessOutput(PhpRemoteSshProcessRunner.java:36)
at com.jetbrains.php.remote.PhpRemoteInterpreterManagerImpl.lambda$getProcessOutput$0(PhpRemoteInterpreterManagerImpl.java:108)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:248)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:592)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2019-02-21 14:34:31,060 [798639205] DEBUG - ins.plugins.webDeployment.sftp - cd "/"
2019-02-21 14:34:31,061 [798639206] DEBUG - ins.plugins.webDeployment.sftp - stat "/home/user/.phpstorm_helpers/build.txt"
2019-02-21 14:34:31,062 [798639207] DEBUG - ins.plugins.webDeployment.sftp - -rw-r--r-- 67886 65071 14 Tue Feb 12 13:51:41 GMT 2019, mtime 1,549,979,501
2019-02-21 14:34:31,063 [798639208] DEBUG - ins.plugins.webDeployment.sftp - get "/home/user/.phpstorm_helpers/build.txt"
2019-02-21 14:34:31,068 [798639213] DEBUG - ins.plugins.webDeployment.sftp - disconnect()
2019-02-21 14:34:31,069 [798639214] INFO - ugins.remotesdk.RemoteTransfer - Remote helpers version is PS-183.5429.47, local helpers version is PS-183.5429.47
2019-02-21 14:34:31,069 [798639214] INFO - ugins.remotesdk.RemoteTransfer - Helpers upload successfully completed
2019-02-21 14:34:31,069 [798639214] INFO - .diagnostic.PerformanceWatcher - Helpers uploaded took 76ms; general responsiveness: ok; EDT responsiveness: ok
2019-02-21 14:34:31,069 [798639214] DEBUG - t.connections.RemoteConnection - Releasing one of the connections to sftp://server:22/ in @36300ba; connections left 0
2019-02-21 14:34:31,070 [798639215] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SSH session @389e52d4 to user@server:22
2019-02-21 14:34:31,083 [798639228] DEBUG - ellij.ssh.SshConnectionService - Executing SSH command: env "JETBRAINS_REMOTE_RUN"="1" '/home/user/bin/phpcs' '--version' within SSH session @389e52d4 to user@server:22

0

That's weird.

Could you please attach a screenshot of an output of SSH run of '/home/user/bin/phpcs' '--version' command?

0

Sure. It was in the first message. Now with the full path:

 

 

Do you think PHPStorm is not being able to correctly parse the output because of this encoding exception?

0

Please sign in to leave a comment.