jjzjj

secure-context

全部标签

php - "proc_open() has been disabled for security reasons"- PHP 错误

proc_open()hasbeendisabledforsecurityreasons我目前正在免费托管(Hostinger)-制作个人网站仅供我和其他一些人使用。我知道我应该从php.ini中删除proc_open,但由于我的共享主机计划,我无法访问它。我的代码中围绕proc_open的代码如下-如果您需要完整代码,请告诉我。我试过注释部分但它返回错误。我只想删除它并允许代码正常运行。=1?true:false;//Commandexecutionfunctionexecute_command($command){$descriptors=array(0=>array('pipe'

php - Magento 2:传递给 Controller::__construct() 的参数 1 必须是 ..\..\..\Action\Context 的实例,给定的 ..\..\..\ObjectManager 的实例

当我尝试运行我的Magento2模块时出现以下错误:Fatalerror:UncaughtTypeError:Argument1passedtoMyModule\Service\Controller\Module\Version::__construct()mustbeaninstanceofMagento\Framework\App\Action\Context,instanceofMagento\Framework\ObjectManager\ObjectManagergiven,calledin/srv/www/vendor/magento/framework/ObjectMan

php - 如何编写 mod_security 友好的 PHP 代码?

我在WordPress中创建了一个主题,该主题在HostGator上触发了mod_security规则并给出了403错误。我联系了那里的人(在HostGator),他们帮我修好了。但我不希望我的主题像这样工作。我只是想知道是否有关于编写对mod_security友好的PHP代码的指南/博客文章/教程?我试过谷歌,但没有找到任何有用的东西。 最佳答案 我不确定是否有很多指南,特别是因为mod_security配置因服务器而异。我最推荐的是看一下CoreRuleSetProject.那里有很多规则。他们有很多。一些一般要避免的事情是:在

php - 身份验证凭证未找到异常 : The security context contains no authentication token

我收到以下错误AuthenticationCredentialsNotFoundException:Thesecuritycontextcontainsnoauthenticationtoken.OnepossiblereasonmaybethatthereisnofirewallconfiguredforthisURL.我已经尝试过解决方案,因为我知道当没有为路由配置安全防火墙时会发生此错误,但我似乎无法解决该错误。这是我的security.ymlsecurity:access_decision_manager:#strategycanbe:affirmative,unanimous

php - 大文件上传时的 Apache 错误 500 (mod_security)

就我所尝试的而言,常用的解决方案都不适合我。好吧,我的问题是,每次我上传“大文件”(600KB~)时都会收到500错误,而较小的图像效果很好。所以...,即使使用这个(极端的).htaccess文件,它也会继续发生,是的,.htaccess是事件的:upload_max_filesize=100Mpost_max_size=100Mmemory_limit=128Mmax_input_time=6000max_execution_time=6000因此,我查看了日志并发现了这一点(只有一行,只是将其粘贴为易于阅读并带有行跳转):[MonJul2717:09:28.2015][:erro

php - 使用 Symfony Security 的简单登录表单

我试着用这个教程做登录表单:http://symfony.com/doc/current/cookbook/security/form_login_setup.html所以,现在我的security.yml文件如下所示:security:providers:in_memory:memory:users:ryan:password:ryanpassroles:'ROLE_USER'admin:password:kittenroles:'ROLE_ADMIN'encoders:Symfony\Component\Security\Core\User\User:plaintextfirewa

php - Symfony 3.3 从 3.2 : Compile Error: Cannot declare class Symfony\Bundle\SecurityBundle\Security\FirewallMap

自从我从symfony3.2更新到3.3后我遇到了一些问题,我得到了这个错误CompileError:CannotdeclareclassSymfony\Bundle\SecurityBundle\Security\FirewallMap,becausethenameisalreadyinuseinclasses.php(line1709)inClassCollectionLoader.php(line99)atClassCollectionLoader::load()inKernel.php(line428)atKernel->doLoadClassCache()inKernel.p

javascript - 我怎么知道 3D Secure 2 身份验证在升级到 stripe.js 版本 3 后有效

我已经更新了一个站点,因此它使用最新的stripe-php(6.39.0),现在它加载了stripe.js版本3。我已经对我的代码进行了所有必要的更改,以便现在显示我的信用卡字段使用Stripe元素。测试交易有效,我更新了实时网站,实际付款被排除在外。我进行此更新的原因是因为stripe通知我需要升级网站,以便其stripe集成将与2019年9月之前欧盟要求的强客户身份验证(SCA)配合使用。Stripe有不同的信用卡测试编号,您可以使用它来测试处理付款时出现的问题。此号码可在此处找到:https://stripe.com/docs/testing#cards4000000000003

php - 错误 : Using $this when not in object context

这个问题在这里已经有了答案:PHPFatalerror:Using$thiswhennotinobjectcontext(9个回答)关闭9年前。我已经查找了涵盖此错误的其他问题,但找不到适用于我的问题的案例。基本上,我的类中的静态方法调用一个非静态方法,该方法反过来调用另一个非静态方法。这会引发fatalerror:Fatalerror:Using$thiswhennotinobjectcontextinclass.phponline...我不明白为什么不能通过$this从另一个非静态类方法调用一个非静态类方法。是因为它们都是从静态函数调用的,因此没有$this实例吗?这是(简化的)类

php - 带有自定义选民的 Symfony @Security 注释

我编写了一个自定义投票器来检查用户是否是他正在尝试编辑的一本书的所有者。因此我使用“@Security”注解来保护Controller:@Security("is_granted('BookVoter::ATTRIBUTE_OWNER',book)")这就是我希望@Security注释看起来像的样子,但它仅在我编写以下内容时有效:@Security("is_granted('OWNER',book)")我不想“硬编码”“OWNER”字符串,它在我的BookVoter中是一个常量。有什么想法可以实现吗?问候。 最佳答案 您传递给@Se