草庐IT

mod_status

全部标签

php - Phil Sturgeon 的 REST API 总是返回 : status:0, 错误:未知方法

我总是遇到这个错误。{"status":false,"error":"Unknownmethod."}但从我这边来看,所有语法都是正确的。因为在浏览器上一切正常,但在设备上集成相同的URL会出现“未知方法错误”。我正在使用这种“获取”方法。示例网址SITEURL/api/login/test?req_type=custom我在集成时是否遗漏了什么?也许是一个设置?我刚刚包含了库和rest配置文件。 最佳答案 我认为你的问题是Controller的名称与方法的名称相同尝试进行测试:如果您的Controller名称是:classTest

php - 为什么带有 PCRE_UTF8 的 PHP preg_match_all 在 CLI 上和通过 Apache/mod_php 给出不同的结果?

以下代码在通过CLI和Apache/mod_php运行时产生不同的结果:$pattern."u",//Addu(PCRE_UTF8)modifier"Non-unicode"=>$pattern);echo"Text:\n'$text'\n";foreach($regexpsas$type=>$regexp){$matches=array();$total=preg_match_all($regexp,$text,$matches);echo"\n\n";echo"$typeregex:\n'$regexp'\n\n";echo"Total$typematches:";var_dump

php - 使用 mod_rewrite 格式化 URL 参数

首先让我在下面向您展示我的.htaccess文件代码RewriteEngineOnRewriteBase/site/public/admin/##hide.phpextensionsnippet#Toexternallyredirect/dir/foo.phpto/dir/fooRewriteCond%{THE_REQUEST}^[A-Z]{3,}\s([^.]+)\.php[NC]RewriteRule^%1/[R,L]#addatrailingslashRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_URI}!/$Rewr

php - symfony2 phpunit : how to get exception message when status code is not expected one

在我的symfony2应用程序中,我使用phpunit来测试每个Controller的Action响应的状态代码是否是预期的。如果不是,我如何让phpunit显示异常附带的错误消息,或者最好模拟一个探查器异常页面?这是因为我在phpunit中有一个返回500代码的操作,但它在我的浏览器中加载得很好。我的代码:/***@dataProviderurlProvider*@param$url*/publicfunctiontestPageIsSuccessful($url){$client=self::createClient(array(),array('PHP_AUTH_USER'=>'

php - 查询字符串和 Mod 重写

我对ReWrite并不太缺乏经验(虽然也不是大师)所以我希望有人能帮助我。RewriteRule^$index.php?page=home[NC]RewriteRule^adm$index.php?page=adm_home[NC]RewriteRule^adm/statsindex.php?page=adm_stats[NC]以上是我的.htaccess文件的片段。可以看到,当有人访问http://www.example.com/adirectory/它实际上调用了index.php?page=home,如果有人访问http://www.example.com/adirectory/

php - HTAccess-Mod_rewrite

如果我使用:RewriteEngineOnRewriteRule^.*controller.php它会将所有请求发送到controller.php但是如果controller.php包含一个css文件(/assets/css/main.css)那么它就不会工作,因为当浏览器调用它时,它只会重定向到controller.php有什么办法可以解决这个问题吗? 最佳答案 您可以添加condition排除可以映射到实际存在文件的URL:RewriteCond%{REQUEST_FILENAME}!-fRewriteRule^.*contro

php - 如何在 lighttpd 中启用 mod 重写

我需要在lighttpd中启用mod_rewrite它不应该显示index.php扩展.... 最佳答案 如果我理解您的问题,您需要将/index重写为/index.php。这应该可以解决问题。server.modules+=("mod_rewrite")url.rewrite-once=("^(.*)$"=>"$1.php");请注意,这也会转发url,例如/image.jpg->/image.jpg.php。如果您需要更复杂的解决方案,请调整您的问题。 关于php-如何在lightt

php - htaccess mod_rewrite 部分 url 到 GET 变量

我有一些这样的URL:http://plutov.by/post/cubique_zf_jqueryhttp://plutov.by/post/mysql_useful_queries如何在Apachemod_rewrite的帮助下打开下一页?http://plutov.by/post/main?title=cubique_zf_jqueryhttp://plutov.by/post/main?title=mysql_useful_queries此外,这个新的重写规则是否适用于“一个入口点重写”?RewriteEngineOnRewriteCond%{REQUEST_FILENAME}

php - 我如何使用 mod-rewrite (iirf) 只重定向 php 文件

我目前设置了重定向(使用IIRF,但我相信这与.htaccess规则相同)以便所有文件都不会被重定向,而是直接转到URL中的文件路径,但其他所有内容被重定向到/index.php使用以下代码:RewriteCond%{REQUEST_FILENAME}!-fRewriteRule^(.*)$/index.php?request=$1[L,QSA]我还需要它来将任何.php文件(但仅限.php文件)重定向到index.php(与第二条规则相同)综上所述,'www.example.com/foo'和'www.example.com/foo.php'都需要转到索引页,但是'www.examp

php - Klarna 结帐返回 http_status_code 500 Internal Server Error 作为响应

我正在尝试使用他们提供的代码实现klarna结帐here.按照此链接的指示实现流程->https://docs.klarna.com/en/getting-started我正在使用docs/examples文件夹中的代码,我已将库(src文件夹)放在正确的路径中,并在我创建测试时提供了eid和共享key以及klarna提供的商店ID和共享key帐号here.//MerchantID$eid='eid';//Sharedsecret$sharedSecret='sharedsecret';我已经替换了所有文件中的所有eid和共享密码,还正确地更改了文件中的链接,i.e.example.c