问题:

我最近通过pear安装程序在我的服务器上安装了phpunit。

当我去运行测试时,我收到以下错误:

PHP警告:require_once(PHPUnit / Util / Filter.php):无法打开流:第44行/ usr / bin / phpunit中没有此类文件或目录

PHP致命错误:require_once():在44行/ usr / bin / phpunit中打开所需的’PHPUnit / Util / Filter.php'(include_path =’。:/ usr / bin / php’)失败

在做了一些搜索之后,我尝试对服务器上的php.ini文件中的include_path进行一些修改。 但这没有做到。

知道可能导致这种情况的原因吗?

I recently installed phpunit on my server via the pear installer.When I go to run a test I get the following error:PHP Warning: require_once(PHPUnit/Util/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 44PHP Fatal error: require_once(): Failed opening required ‘PHPUnit/Util/Filter.php’ (include_path=’.:/usr/bin/php’) in /usr/bin/phpunit on line 44After doing some searching, I tried making some modifications to the include_path in my php.ini file on the server.But that hasn’t done a thing.Any idea what might be causing this?

问题:

我已经从php.net粘贴了在php中使用memcached的示例,并且得到了:

Fatal error: Class 'Memcache' not found

我的php.ini中有这个:

[内存缓存]
memcache.hash_strategy =“一致”
memcache.max_failover_attemps = 100
memcache.allow_failover = 1

这是分别来自php -i和php -m的信息:

php -i | grep -i内存缓存
记忆快取
memcached支持=>已启用
libmemcached版本=> 0.37
注册的保存处理程序=>文件用户sqlite memcached

php -m | grep -i内存缓存
记忆快取

因此php似乎已将memcached作为模块加载,并且php info表示已加载并正在使用v .37。 我还没有通过apache尝试过,我现在只是通过cli来使用它。 有什么想法吗?

I’ve pasted the example from php.net for using memcached in php and I’m getting:I have this in my php.ini:[memcache]memcache.hash_strategy = “consistent”memcache.max_failover_attemps = 100memcache.allow_failover = 1Here’s info from php -i and php -m respectively:php -i |grep -i memcachememcachedmemcached support => enabledlibmemcached version => 0.37Registered save handlers => files user sqlite memcachedphp -m |grep -i memcachememcachedSo php seems to have loaded memcached as a module, and php info says that it is loaded and is using v .37.I have not tried yet via apache, I’ve only been using this through cli right now.Any thoughts?

问题:

我想在PHP CodeIgniter中记录错误。 如何启用错误记录?

我有一些问题:

  1. 记录错误的所有步骤是什么?
  2. 如何创建错误日志文件?
  3. 如何将错误消息推送到日志文件中(每当发生错误时)?
  4. 你如何通过电子邮件将该错误发送到电子邮件地址?

I want error logging in PHP CodeIgniter.How do I enable error logging?I have some questions:What are all the steps to log an error?How is an error log file created?How to push the error message into log file (whenever an error occurs)?How do you e-mail that error to an email address?

问题:

我在我的控制器中检查了一些验证。 而且我想在失败时将错误添加到表单的特定元素中。 我的表格:

use Symfony\Component\Form\FormError;

// ...

$config = new Config();
$form = $this->createFormBuilder($config)
        ->add('googleMapKey', 'text', array('label' => 'Google Map key'))
        ->add('locationRadius', 'text', array('label' => 'Location radius (km)'))
        ->getForm();

// ...

$form->addError(new FormError('error message'));

addError()方法向表单添加错误,而不是元素。 如何向locationRadius元素添加错误?

I check some validation in my controller.And I want to add error to specific element of my form on failure.My form:addError() method adds error to form, not to element.How can I add an error to locationRadius element?