当我关闭PhpStorm中的文件时,它会自动保存文件.如何更改它以问我"你想在关闭之前保存文件吗?"
我是PhpStorm的新手,我很喜欢它,但是当我编写HTML标签的属性时,无法找到如何禁用双引号的自动完成.我习惯不放他们,这对我来说很烦人.
我能够在PHPStorm中设置一个php web app调试器,只需将它绑定到我在特定端口的localhost即可,一切正常.但是要实现这一点,我需要先在shell上运行此命令:
php app/console server:run --env=dev
Run Code Online (Sandbox Code Playgroud)
如果我设置断点来浏览网站本身或测试来自基于浏览器的休息客户端(如邮递员)的 api调用,这样就可以了
但是,我正在尝试为我的移动应用程序设置断点(移动应用程序将http调用发送到后端应用程序,这是一个symfony应用程序).使用Web应用程序配置不适用于此配置.
使用本教程,我能够将上述命令行合并到PHPStorm中,所以现在我可以使用phpstorm命令行工具实际运行代码.
我的问题是:如何将调试器实际绑定到PHPStorm中的命令行?现在,当我在PHPStorm中创建内置Web服务器时,它默认使用默认的php解释器(即如果我使用内置的Web服务器运行代码..我在PHPStorm的控制台中看到了这一点:
/usr/local/Cellar/php54/5.4.28/bin/php -S localhost:8000 -t /project/root/directory
Run Code Online (Sandbox Code Playgroud)
我想要的是这样的:
php app/console server:run --env=dev -S localhost:8000 -t /project/root/directory
Run Code Online (Sandbox Code Playgroud)
知道怎么做吗?
我为PhpStorm和xdebug配置了所有工作,我正在运行Ubuntu 14.04.
没有建立回IDE的连接,我在IDE事件Log中得到了这个
无法接受外部Xdebug连接:无法计算表达式'isset($ _ SERVER ['PHP_IDE_CONFIG'])' - Osama Salama 13分钟前
我将把我在不同地方配置的配置值放在一起.因为我无法找出问题所在
php.ini中
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back = 1
xdebug.remote_autostart = 1
xdebug.remote_log=xxx/xdebug.log
xdebug.IDE_key=PHPSTORM
Run Code Online (Sandbox Code Playgroud)
PHP信息
Xdebug的
xdebug support enabled
Version 2.3.1
IDE Key PHPSTORM
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable …Run Code Online (Sandbox Code Playgroud) 我最近加入了最新的Laravel 5.3.在该gulp.js文件中,有更新的ES6箭头函数语法:
elixir(mix => {
mix.sass('app.scss')
.webpack('app.js');
});
Run Code Online (Sandbox Code Playgroud)
PhpStorm 2016.2显示了此代码错误:
Expression statement is not assignment or call.
Run Code Online (Sandbox Code Playgroud)
此外,代码自动格式化程序在遇到此问题时会将所有内容搞砸,因为它将其视为错误.
如何让PhpStorm停止显示为错误?
我想尝试 Xdebug 3.0.0RC1 来探索发生了什么变化以及随之而来的新功能。我也在使用最新的 PhpStorm 2020.3 EAP,它支持 Xdebug 3,不需要主要配置。下面是我的调试器的 PhpStorm 配置:
这是我为 Xdebug3 尝试的配置:
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal # here I tried several combinations like: "localhost", "127.0.0.1", "172.17.0.1"
xdebug.client_port=9001 # here I tried several ports 9003 included with no success
Run Code Online (Sandbox Code Playgroud)
我也试过根本不添加client_host/client_port设置,但仍然失败。
我收到此错误:
Script php bin/console doctrine:cache:clear-metadata returned with error code 255
!! [17-Nov-2020 15:24:40 UTC] Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9001 (through xdebug.client_host/xdebug.client_port) :-(
!! [17-Nov-2020 15:24:41 UTC] PHP Fatal error: Method class@anonymous::__toString() …Run Code Online (Sandbox Code Playgroud) 我使用PHPStorm作为调试PHP的主要工具,我非常高兴.到目前为止,我一直在使用Firefox来运行脚本,PHPStorm可以完美地捕获它们.
现在我有一种情况,我通过命令行(而不是浏览器)运行PHP脚本,并想知道是否有办法设置PHPStorm以通过命令行运行PHP脚本时捕获中断?
首先要做的事情:
重要:XDebug也在Apache和我的Win7防火墙上正确配置.我知道b/c我可以使用Eclipse进行调试.
所以我失败的似乎是PHPStorm的基本配置.
让我来介绍一些细节:
我要调试的文件是index.php:
无论我拼凑什么......我得到了一些错误消息,比如"等待来自JetBrains PhpStorm的连接..."或者PHPStorm要求我提供Mozillas profile.ini,即使我在网页浏览器中将Chrome配置为默认值.
所以我将建立一个新项目,希望有人告诉我我的配置有什么问题.
运行/编辑配置/默认值/ PHP远程调试:
服务器:
C:\ dev\sf\Symfony =>/mnt/hgfs/sf/Symfony(也试过/ Symfony - b/c PHPStorm不应该关心/ Symfony上面的任何东西!?)
运行/编辑配置/默认值/ PHP Web应用程序:
现在我选择:Run/Debug .../1.index.php
我被问到:Mozilla的profile.ini ......但我找不到它
它在哪里 ... ?
到目前为止,我已经开始使用PHPStorm启动Chrome了.但也许我先解决这个问题.那么如何让Firefox运行起来呢?我也使用Firefox与Eclipse ...没有问一个profile.ini的问题.
嘿我在PHPstorm中连接FTP时遇到问题.我知道我有正确的参数,因为它适用于其他FTP客户端.
我得到的错误是:无法列出文件夹" ftp://real-meal.com/ "的内容
端口设置为21,应该是.我知道我有正确的用户名/密码.任何想法可能是什么问题?
这是日志文件:
2013-08-22 14:31:40,053 [8689769] INFO - api.vfs.impl.local.FileWatcher - Change requests:38912, filtered:15503
2013-08-22 14:35:55,090 [8944806] INFO - api.vfs.impl.local.FileWatcher - Change requests:39936, filtered:15933
2013-08-22 14:36:12,356 [8962072] WARN - i.remotebrowser.ServerTreeNode - Could not list the contents of folder "ftp://real-meal.com/".
org.apache.commons.vfs2.FileSystemException: Could not list the contents of folder "ftp://real-meal.com/".
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:926)
at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:443)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChild(AbstractFileObject.java:1006)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.createConnection(RemoteConnectionPool.java:124)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionManager.openConnection(RemoteConnectionManager.java:122)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeContext.getConnection(ServerTreeContext.java:83)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.computeFile(ServerTreeNode.java:266)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.getChildren(ServerTreeNode.java:132)
at com.intellij.ui.treeStructure.SimpleTreeStructure.getChildElements(SimpleTreeStructure.java:25)
at com.intellij.ide.util.treeView.AbstractTreeUi$31.run(AbstractTreeUi.java:1618)
at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
at com.intellij.ide.util.treeView.AbstractTreeUi.getChildrenFor(AbstractTreeUi.java:1615)
at com.intellij.ide.util.treeView.AbstractTreeUi.access$4600(AbstractTreeUi.java:60)
at com.intellij.ide.util.treeView.AbstractTreeUi$46.run(AbstractTreeUi.java:2702)
at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824) …Run Code Online (Sandbox Code Playgroud) 在jetbrains(phpstorm)中,选择当前单词的键盘快捷键是什么?(我的意思是光标所在的单词)