我的工作设置是Windows XP主机,运行Ubuntu VM LAMP堆栈.我正在使用PhpStorm在我的主机Windows机器上编辑我的代码.保存文件后,会自动通过SFTP上传到VM.除了调试之外,一切都适用于此过程.
我已经将PhpStorm设置为具有名为"UbuntuVM"的服务器,其中包含以下设置:
调试器:
- XDebug
调试会话设置:
- 在第一行中断
- 等待与ide键的连接:XDEBUG_PHPSTORM
在启动之前:
- 将文件上载到选定的服务器
我正在使用Chrome和Xdebug Helper,并将扩展设置为使用"其他"作为IDE,以"XDEBUG_PHPSTORM"为关键.
VM在php.ini中有以下内容:
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=10.1.6.22
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.collect_params=On
xdebug.show_local_vars=On
Run Code Online (Sandbox Code Playgroud)
当我在IDE中设置断点时,在Chrome中启用调试器,然后重新加载页面,我从未达到过断点; 并且IDE说"等待端口9000上的连接与ide键'XDEBUG_PHPSTORM'".
有谁知道为什么我没有达到我的破发点?
我试图使用PHP的PDO实现获得我的MySQL服务器的从属状态.运行fetchAll()返回一个空数组.
// DB IP, name, username, and password are fake here. I can connect.
$db = new PDO('mysql:host=192.168.0.0;dbname=production', 'username', 'password');
$result = $db->query("SHOW SLAVE STATUS");
$result->execute();
if ($result != false)
{
$slave = $result->fetchAll(PDO::FETCH_ASSOC);
}
Run Code Online (Sandbox Code Playgroud)
我也试过删除->execute()呼叫,但结果相同.有什么东西是我在这里遗失的吗?我在PDO ::查询文档中上下查找,并没有多大帮助.
我刚刚安装了一个新的CentOS 6.3 VM并禁用了SELinux.下面是我运行安装Ruby,Chef Solo并尝试配置VM的确切脚本:
#!/bin/bash
#
# Install Chef-Solo if it doesn't exist, then provision the server.
#
CHEF_FILE="https://dl.dropbox.com/u/4204671/LiquidCompass/lc-chef.tar.gz"
if [ "$#" -eq 0 ]; then
echo "You must provide the type of server this is. (Eg: production-api, qa-api, development)"
exit 1
fi
if [ ! -x "/usr/bin/chef-solo" ]; then
rpm -Uvh http://rbel.frameos.org/rbel6
yum install -y ruby ruby-devel ruby-ri ruby-rdoc ruby-shadow gcc gcc-c++ automake autoconf make curl dmidecode
cd /tmp
curl -O http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar zxf rubygems-1.8.10.tgz
cd rubygems-1.8.10
ruby setup.rb …Run Code Online (Sandbox Code Playgroud) 我试图将我的一个Subversion存储库移动到Git并遇到一个有趣的错误...在git-svn fetch步骤中,我收到以下错误:
r9 = d0eff6b2d1eda7fcced16227dbc613732e956f0b (refs/remotes/git-svn)
RA layer request failed: PROPFIND request failed on '/baytn/baytn/trunk': PROPFI
ND of '/baytn/baytn/trunk': 500 Internal Server Error (https://1three.svn.codeba
sehq.com) at C:\Program Files\Git/libexec/git-core/git-svn line 5047
Run Code Online (Sandbox Code Playgroud)
当我查看SVN存储库的修订历史时,我看到修订版#9是一个空提交,这是怎么发生的,我不确定.
有什么方法可以解决这个错误吗?
最好的问候,
安德鲁
我正在尝试roles/logging.logWriter使用 Terraform创建一个具有IAM 角色的基本服务帐户。下面是我如何配置这个:
resource "google_service_account" "log_user" {
account_id = "log-user"
display_name = "Logging User"
}
data "google_iam_policy" "log_policy" {
binding {
role = "roles/logging.logWriter"
members = [
"serviceAccount:${google_service_account.log_user.email}"
]
}
}
resource "google_service_account_iam_policy" "log_user_policy" {
service_account_id = "${google_service_account.log_user.name}"
policy_data = "${data.google_iam_policy.log_policy.policy_data}"
}
Run Code Online (Sandbox Code Playgroud)
运行时,terraform apply我收到以下错误消息:
* module.iam.google_service_account_iam_policy.log_user_policy: 1 error(s) occurred:
* google_service_account_iam_policy.log_user_policy: Error setting IAM policy for service account 'projects/arcadia-apps-237918/serviceAccounts/log-user@arcadia-apps-237918.iam.gserviceaccount.com': googleapi: Error 400: Role roles/logging.logWriter is not supported for this resource., badRequest
Run Code Online (Sandbox Code Playgroud)
从我所做的挖掘中,我似乎无法找到关于如何创建服务帐户然后为其附加角色的明确解释。
在我正在研究这个项目之前,我从来没有需要在MySQL数据库上进行随机选择.在研究之后,人们普遍认为使用RAND()是一个坏主意.我发现了一篇文章解释了如何进行其他类型的随机选择.
基本上,如果我想选择五(5)个随机元素,我应该做以下(我在这里使用Kohana框架)?
<?php
final class Offers extends Model
{
/**
* Loads a random set of offers.
*
* @param integer $limit
* @return array
*/
public function random_offers($limit = 5)
{
// Find the highest offer_id
$sql = '
SELECT MAX(offer_id) AS max_offer_id
FROM offers
';
$max_offer_id = DB::query(Database::SELECT, $sql)
->execute($this->_db)
->get('max_offer_id');
// Check to make sure we're not trying to load more offers
// than there really is...
if ($max_offer_id < $limit)
{
$limit = $max_offer_id;
}
$used …Run Code Online (Sandbox Code Playgroud) 我无法让 Intellisense 完全使用 ES6 导入。
执行以下操作可使/index.jsIntellisense 正常工作:
但是,从/index.js中断 Intellisense执行以下操作:
目录结构为:
| modules
|-- cars.js
|-- index.js
| index.js
| jsconfig.json
Run Code Online (Sandbox Code Playgroud)
每个文件的内容是:
模块/cars.js
export default {
audi: 'R8',
dodge: 'Durango',
};
Run Code Online (Sandbox Code Playgroud)
模块/index.js
import cars from './cars';
export default {
cars,
};
Run Code Online (Sandbox Code Playgroud)
jsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs"
},
"exclude": [
"node_modules"
]
}
Run Code Online (Sandbox Code Playgroud) php ×3
mysql ×2
centos ×1
chef-infra ×1
debugging ×1
ecmascript-6 ×1
git ×1
git-svn ×1
intellisense ×1
kohana-3 ×1
master-slave ×1
pdo ×1
phpstorm ×1
provisioning ×1
random ×1
svn ×1
terraform ×1
xdebug ×1