草庐IT

unknown-host

全部标签

php - localhost/live - 通过 HTTP_HOST 检测

假设我在本地开发并在实时服务器上调试小东西。在我的代码中加入这样的东西是个好主意吗?:$is_local=(strpos($_SERVER['HTTP_HOST'],'localhost')!==false);define('DEBUG',$is_local);然后在设置内容时通过我的代码使用它?$mysql_settings=(DEBUG)?array(/*localhostsettings*/):array(/*livesettings*/);这样,我可以在本地和本地主机上使用相同的文件,所以我可以同步而不用担心出错,例如实时服务器上的连接设置。这个想法是好是坏?

php - preg_match() 什么时候做 : Unknown modifier error occur?

\\$DigitalSignaturehavefullnamevaluepassed$SignatureMatch='/'.strtolower($NameFirst.''.$NameLast).'$/';if(true==preg_match($SignatureMatch,strtolower($DigitalSignature))){$boolIsValid=true;}我正在使用此代码来精确匹配名字和姓氏与数字签名的匹配。但这会在生产(实时)错误日志中向我报告错误。preg_match():Unknownmodifier'b'我无法重现此错误。我怎样才能首先得到这个错误。以及如

php - Laravel - Guzzle 请求/cURL 错误 6 : Could not resolve host

我尝试向GithubAPI发出API请求以进行测试。我在我的Laravel5.1APP上安装了最新的Guzzle版本("guzzle/guzzle":"^3.9")。在我的routes.php中,我有以下代码:Route::get('guzzle/{username}',function($username){$client=newClient(['base_uri'=>'https://api.github.com/users/',]);$response=$client->get("/users/$username");dd($response);});如果我现在访问URLdoma

PHP 警告 : No such file or directory in Unknown on line 0

我在Linux中使用托管,并在Apache2服务器的网站中配置了子域。我正在使用laravel,但默认情况下我没有使用apache2服务。我正在使用laravelartisan命令。phpartisanserve--host0.0.0.0它会监听8000端口。所以为了访问我的网站,我使用了http://myipaddress:8000。访问它。我试过“chmod755or777publicfolder”但还是没用。我的.htaccess在laravel/public文件夹中.htaccessOptions-MultiViewsRewriteEngineOn#RedirectTraili

php - $_SERVER ['HTTP_HOST' ] = 不是我的服务器的 ip

我的php脚本有$_SERVER['HTTP_HOST']等于一个与我服务器的ip无关的ip。有人有简单的解释吗?(我在想一些机器人正在发送一个完全错误的主机头,但我不认为它可以连接到一个错误主机头的服务器=/)谢谢 最佳答案 HTTP_HOST由客户端提供,在HTTP请求的Host:部分。它可以任意改变,虽然我不明白为什么有人会想要。参见themanualpage.改用$_SERVER['SERVER_NAME']。这是由服务器本身定义的。 关于php-$_SERVER['HTTP_H

php - 找不到列 : 1054 Unknown column '_token' in 'field list' Laravel

我尝试更新我的表类别的记录,但它显示错误Columnnotfound:1054Unknowncolumn'_token'路线Route::post('/categorias/edit/{id}','CategoryController@update');Controllerpublicfunctionupdate(Request$request,$id){$data=request()->all();Categoria::where('id','=',$id)->update($data);returnredirect()->to('categorias');}型号classCateg

php - 警告 : File upload error - unable to create a temporary file in Unknown on line 0

每次尝试上传文件时都会出现以下错误。“警告:文件上传错误-无法在第0行的未知中创建临时文件”这是我的HTML表单,ProductNameProductPriceRs:CategoryBedroomLivingroomDiningSub-CategoryDiningtablesshoerackswardrobessofaProductDetailsProductImage 这是我的PHP代码,if(isset($_POST["product_name"])){$product_name=mysql_real_escape_string($_POST["product_name"

php - "Unknown"PHP 错误 - 这是什么意思?

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:Howtofix“Headersalreadysent”errorinPHP[MonJan1021:01:262011][error][clientxx.xx.xxx.xx]PHPWarning:Cannotmodifyheaderinformation-headersalreadysentinUnknownonline0,referer:www.example.com/some.php为什么PHP无法定位header的发送位置?

PHP 警告 : Module 'imagick' already loaded in Unknown on line 0

我有一个简单的测试文件,其中唯一的php代码是:if(isset($_REQUEST['back'])&&($back!='')){$back=$_REQUEST['back'];}$filename='images/'.$back.'.jpg';$file=(file_exists($filename))?$back:'back1';现在每次运行该文件时,我都会在错误日志中添加此行PHPWarning:Module'imagick'alreadyloadedinUnknownonline0。有什么建议吗? 最佳答案 打开你的php

php - cURL 错误 35 : Unknown SSL protocol error in connection to api. mailgun

突然间我开始收到这个mailgun错误,GuzzleHttp\Exception\RequestExceptioncURLerror35:UnknownSSLprotocolerrorinconnectiontoapi.mailgun.net:443任何邮件枪用户请帮助我谢谢 最佳答案 我在使用Laravel4.2和Mailgun时遇到了同样的问题。我已经联系了MG,他们将此错误归咎于他们一直遭受的DDoS攻击。我将此线程包含在我最新的支持票中。如果您有任何有用的信息可以帮助他们,请在此处提供。我注意到它只发生在每天清晨到中午。Ma