草庐IT

project-hosting

全部标签

php 数据库库,错误 : SQLSTATE[HY000] Unknown host machine name (severity 2)

我使用的是mac电脑OSX10.9。Freetds和unixODBC已经安装在我的电脑上并作为扩展添加到php,试图连接到远程MSSQL服务器。下面是我的连接测试:错误日志文件显示:[error][client127.0.0.1]PHPFatalerror:Uncaughtexception'PDOException'withmessage'SQLSTATE[HY000]Unknownhostmachinename(severity2)可能是什么问题?如果我使用终端连接到同一个数据库,我的freetds和unixODBC似乎工作正常,如下所示:$isqlHostnameuserpw+-

php - 在 Google API v2 中,为什么会发生错误 "The project id used to call the Google Play Developer API has not been linked"?

当我使用GoogleAPIv2时,获取一个inapplisting,我在进行API调用时遇到以下错误:{"error":{"errors":[{"domain":"androidpublisher","reason":"projectNotLinked","message":"TheprojectidusedtocalltheGooglePlayDeveloperAPIhasnotbeenlinkedintheGooglePlayDeveloperConsole."}],"code":403,"message":"TheprojectidusedtocalltheGooglePlayD

php - 使用 vagrant/puppet 自动设置 xdebug.remote_host ip 地址

我正在使用puppet设置Vagrant环境。我遇到了一个问题,我希望xdebug在运行vagrantup时“正常工作”,但是我需要在php.ini文件中指定主机IP地址xdebug.remote_host,显然这在使用配置的每台机器上都会有所不同,所以我想要一种在发出vagrantup时自动更新该值的方法。Vagrant文件:config.vm.network:forwarded_port,guest:9000,host:9000.ini设置:'xdebug.default_enable=1','xdebug.remote_enable=1','xdebug.remote_handl

php - PHP Cookie 参数中 Host 和 Domain 的区别

假设我有两个sessioncookie,看起来像第一个Name:d58ba4091c622661a0d46f03b412ac8bContent:m9ciub2u3ig59638r43uqjb8e6Host:www.example.comPath:/Sendfor:AnytypeofconnectionExpires:Sunday,February27,20115:50:18PM第二个Name:testContent:kdfssdfb2ufdfjww3436detasdDomain:.www.example.comPath:/Sendfor:AnytypeofconnectionExpi

PHP 错误 - 已定义常量 DB_HOST?

我正在做一个小家庭作业,我们正在制作一个非常初级的CMS。我们要填写一个包含标题、正文和固定链接的表格。CMS然后获取永久链接,并将其添加到主导航栏。当在导航栏上单击该永久链接时,将显示标题、内容、创建的日期戳和修改的日期戳。我有那个东西在工作,唯一的问题是当我点击导航链接时,我收到此通知:Notice:ConstantDB_HOSTalreadydefinedinC:\ProgramFiles\xampp\htdocs\php\assignment_6\config.phponline2Notice:ConstantDB_USERalreadydefinedinC:\ProgramF

php - $_SERVER ["HTTP_HOST"] 有多安全?

我有一个充满网站url的数据库,主键是网站的$_SERVER["HTTP_HOST"]。当用户导航到...让我们说www.my-epic-example-url.com时,它将连接数据库并使用$_SERVER["HTTP_HOST"]该网站,然后获取引用该网站的所有数据!我想知道的是,$_SERVER["HTTP_HOST"]有多安全?可以外部修改吗?我问的唯一原因是因为我前一段时间读了一篇文章(不记得它在哪里)说使用$_SERVER时要小心,因为它不安全...这是真的吗? 最佳答案 $_SERVER["HTTP_HOST"]是从客

php - Wamp 服务器 : Multiple Virtual Hosts are not working on Windows

我在Windows上有两个虚拟主机(例如:test1.dev和test2.dev)。但它总是为两个虚拟主机加载test1.dev的内容。以下是我的文件:主持人:127.0.0.1localhost127.0.0.1test1.dev127.0.0.1test2.devhttpd.conf:SSLRandomSeedstartupbuiltinSSLRandomSeedconnectbuiltinInclude"c:/wamp/alias/*"ServerNametest1.devDocumentRoot"C:\wamp\www\test1\public"ServerNametest2.

php - 消息 : Undefined index: REMOTE_HOST in $_SERVER

当我尝试检索远程用户的主机名时,为什么会出现此错误?Message:Undefinedindex:REMOTE_HOST在阅读文档时,我开始知道它需要在httpd.conf中启用。但是我不确定需要在httpd.conf中编辑什么。 最佳答案 这不是错误,这是一个通知。REMOTE_HOST并非在所有情况下都定义。REMOTE_ADDR是。如果需要,您需要重新配置网络服务器。HostnameLookupsOn可以做到,但会导致速度变慢。备选方案:让PHP执行查找,因此您可以在不需要时跳过它(为了提高速度):$r=$_SERVER["R

php - Project Euler #19 代码似乎是正确的。我错过了什么?

问题19:Youaregiventhefollowinginformation,butyoumayprefertodosomeresearchforyourself.1Jan1900wasaMonday.ThirtydayshasSeptember,April,JuneandNovember.Alltheresthavethirty-one,SavingFebruaryalone,Whichhastwenty-eight,rainorshine.Andonleapyears,twenty-nine.Aleapyearoccursonanyyearevenlydivisibleby4,b

php - Composer : List Project Scripts and Plugins?

composer是否有任何内置的方式来显示当前项目中的插件列表?或者是通过vendor中的composer.json文件查找Composer插件的唯一选择,例如$findvendor-namecomposer.json|xargsgrep-i-r'composer-plugin' 最佳答案 由于Composer插件必须需要composer-plugin-api包(参见Composerdocumentation),您可以使用此命令列出插件:composerdependscomposer-plugin-api此处有更多详细信息:http