我试图解析我的apache2错误日志,我有点麻烦..它似乎没有匹配过滤器.我很确定时间戳是错误的,但我不确定,我真的找不到任何文件来解决它.另外,有没有办法让fields.errmsg我得到什么@message?
日志
[Wed Jun 26 22:13:22 2013] [error] [client 10.10.10.100] PHP Fatal error: Uncaught exception '\Foo\Bar'
Run Code Online (Sandbox Code Playgroud)
托运人配置
input {
file {
'path' => '/var/log/apache2/*-error.log'
'type' => 'apache-error'
}
}
filter {
grok {
type => "apache-error"
pattern => "\[%{HTTPDATE:timestamp}\] \[%{WORD:class}\] \[%{WORD:originator} %{IP:clientip}\] %{GREEDYDATA:errmsg}"
}
}
output {
stdout {}
redis {
'data_type' => 'list'
'host' => 'logstash.server.net'
'key' => 'logstash'
}
}
Run Code Online (Sandbox Code Playgroud) 编辑 现在有可能在symfony 2.2中这样做
PlatformFooBundle:
resource: "@PlatformFooBundle/Resources/config/routing.php"
domain: foo.testdomain.com
PlatformBarBundle:
resource: "@PlatformBarBundle/Resources/config/routing.php"
domain: bar.testdomain.com
PlatformBazBundle:
resource: "@PlatformBazBundle/Resources/config/routing.php"
domain: baz.testdomain.com
Run Code Online (Sandbox Code Playgroud)
您也可以使用域中的参数
编辑过
在将其标记为重复之前,请继续阅读
http://www.craftitonline.com/2011/08/symfony2-locale-on-subdomains-not-on-the-url-path/
我读过这篇文章,但它并没有帮助我做我想做的事情.
我有3个不同的应用程序在相同的域名上运行,具有单独的子域名.目前,他们都在自己的symfony安装中运行,我想摆脱它.
foo.testdomain.com
bar.testdomain.com
baz.testdomain.com
Run Code Online (Sandbox Code Playgroud)
每个都使用不同的捆绑
PlatformFooBundle
PlatformBarBundle
PlatformBazBundle
Run Code Online (Sandbox Code Playgroud)
他们每个人都有自己的路线定义.
基本上,我想要的是这个
PlatformFooBundle:
resource: "@PlatformFooBundle/Resources/config/routing.php"
subdomain: www|devwww
PlatformBarBundle:
resource: "@PlatformBarBundle/Resources/config/routing.php"
subdomain: bar|devbar
PlatformBazBundle:
resource: "@PlatformBazBundle/Resources/config/routing.php"
subdomain: baz|devbaz
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
就像标题所说,onstatechange如果pushState函数被调用,我希望能够执行不同的事件,而不是back函数.或者,如果go功能为负或正.
例:
如果History.pushState()或被History.go(1)调用,我想要statechange事件的回调forwardPushState
如果History.back()或被History.go(-1)调用,我想要statechange事件的回调backwardsPushState
javascript javascript-events browser-history history.js html5-history
我试图解决一个可以比较表中的2列的问题.表格如下
------------------------------------------
| from | to | Country |
------------------------------------------
| 25.0.0.1 | 25.255.255.255 | denmark |
------------------------------------------
| 68.0.0.1 | 68.255.255.255 | USA |
Run Code Online (Sandbox Code Playgroud)
我的问题是我有一个ip,25.195.32.0我想将它与from和to列进行比较并返回country name.
基本上,我有一个代码分支连接到三个不同的实体管理器(以及随后的三个不同的MySQL数据库).不幸的是,其中两个数据库的表名称相同,所以我不能将所有实体放在同一个目录中,对于结构,id就像要避免那样.
所以,我的问题是......我将如何设置它以便我可以拥有一个单独的实体包,其中的子目录位于Entity\和Resources\config\doctrine\
例如
Acme\EntityBundle\Entity\DB1\Test.php
Acme\EntityBundle\Entity\DB1\Acme.php
Acme\EntityBundle\Entity\DB2\Test.php
Acme\EntityBundle\Entity\DB2\Foo.php
Acme\EntityBundle\Entity\DB3\Bar.php
Run Code Online (Sandbox Code Playgroud)
同样的想法 Resources\config\doctrine\
在这里做什么,配置非常模糊......
每次我尝试运行时composer install,依赖关系都会因以下错误而失败:
The requested package php could not be found
Run Code Online (Sandbox Code Playgroud)
我已经在LAMP堆栈上工作,但我现在正试图让它在LEMP堆栈上工作,使用php5-fpm并且它不顺利.
$ php -v
PHP 5.5.8-3+sury.org~precise+2 (cli) (built: Jan 29 2014 13:23:55)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
Run Code Online (Sandbox Code Playgroud)
编辑
我有其他的东西,但我composer.json在同一台服务器上测试了以下内容,它仍然在做.
composer.json
{
"require": {
"php": "5.4.*"
}
}
Run Code Online (Sandbox Code Playgroud)
我的作曲家版本是
Composer version b7a9ea4187bce63f418bf7ba035b63dcb1e23ef6 2014-02-06 22:07:47
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
使用新的symfony2 beta4实现swiftmailer时遇到一些问题,下面是我的代码
$mailer = $this->container->get('mailer');
$name = ucwords(str_replace('.',' ', $user->getScreenName()));
$email = 'me@me.com'; //$user->getEmail();
$message = $mailer::newInstance()
->setSubject('New Password')
->setFrom('Neokeo <blah@blah.com>')
->setTo("$name <$email>")
->setBody($this->renderView('MyBundle:User:reset.html.php', array('user',$user)));
$mailer->send($message);
Run Code Online (Sandbox Code Playgroud)
和错误
Catchable fatal error: Argument 1 passed to Swift_Mailer::newInstance() must implement interface Swift_Transport, none given
Run Code Online (Sandbox Code Playgroud)
有没有人知道我能做些什么来解决这个问题?
因此,我试图将一个表单嵌入到另一个表单而不创建表单类.继承人我得到了什么
$form = $this
->buildForm('UserAlert', $alert)
->add('Alert', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Alert', 'property' => 'name', 'required' => true))
->add('Site', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Site', 'property' => 'name', 'required' => false))
->add('Keyword', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Keyword', 'property' => 'name', 'required' => false))
->add('Variant', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Variant', 'property' => 'name', 'required' => false))
->add('Name', 'text');
$uac = $alert->getUserAlertConfig();
$subform = $this
->buildForm('UserAlertConfig', $uac)
->add('EmailAlert', 'choice', array('choices' => array('1' => 'Yes', '0' => 'No'), 'required' => true, 'label' => 'Email Alerts'))
->add('EmailHours', 'text', array('required' …Run Code Online (Sandbox Code Playgroud) apache2: libmemcached/storage.cc:341: memcached_return_t memcached_send_ascii(memcached_st*, memcached_server_write_instance_st, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Run Code Online (Sandbox Code Playgroud)
我不知道是什么导致它抛出,抛出时,或为什么.
这是致命错误吗?如果是这样,有谁知道我可以在哪里解决它?
如果用户不在某个IP范围内,有没有办法要求使用htpasswd?
编辑:
KI现在有这个
Order Deny,Allow
Deny from all
AuthName "Htacess"
AuthUserFile /var/www/Test/.htpasswd
AuthType Basic
Require valid-user
Allow from 111.111.111.111
Satisfy Any
Run Code Online (Sandbox Code Playgroud)
但它给了我500错误
如何使用algolia获取索引中的记录总数?
我想避免使用每页设置为一百万或一些东西的多个项目进行空搜索.
我正在尝试构建一个与内部应用程序交互的扩展,我正在查看外部消息传递内容的文档,但是每当我尝试访问时chrome.runtime.onMessageExternal.addListener,我都会收到一条错误消息,指出chrome.runtime.onMessageExternal未定义。同样的事情onConnectExternal
清单,json
{
"manifest_version": 2,
"name": "My Extension",
"description": "My Desc",
"version": "0.2",
"externally_connectable": {
"matches": [
"http://*.mysite.com/*"
]
},
"author": "Aaron Scherer",
"content_scripts": [
{
"matches": [
"http://*.mysite.com/*"
],
"js": ["js/script.js"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
js/script.js
chrome.runtime.onMessageExternal.addListener(
function( request, sender, sendResponse ) {
debugger;
console.debug( request );
console.debug( sender );
console.debug( sendResponse );
} );
Run Code Online (Sandbox Code Playgroud)
网站的js
chrome.runtime.sendMessage( 'myextid', { test: 'test' } );
Run Code Online (Sandbox Code Playgroud) 我已经使用HTML一段时间了,我刚刚开始使用PHP我创建了一个带有使用PHP include函数的菜单的简单页面.该菜单有效,但我想知道如何设置一个原始包含文件,当单击其中一个菜单按钮时,该文件被替换.这是我的代码:
<html>
<head>
<title>
Test
</title>
</head>
<body>
<?php
include 'header.php';
?>
<form action="" method="post">
<input type="submit" name="Home" value="Home" />
<input type="submit" name="AboutUs" value="About Us" />
<input type="submit" name="Games" value="Games" />
<input type="submit" name="Pages" value="Pages" />
</form>
<?php
if (isset($_POST['Home']))
{
include 'home.php';
};
if (isset($_POST['AboutUs']))
{
include 'au.php';
};
if (isset($_POST['Games']))
{
include 'games.php';
};
if (isset($_POST['Pages']))
{
include 'pages.php';
};
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我希望它在页面首次加载时包含home.php,然后在按下其中一个菜单按钮时将其替换.我怎么能用PHP做到这一点?或者,还有更好的方法?
php ×8
symfony ×4
javascript ×3
apache2 ×2
.htaccess ×1
algolia ×1
apache ×1
composer-php ×1
doctrine-orm ×1
history.js ×1
logstash ×1
memcached ×1
mysql ×1
php-include ×1
swiftmailer ×1