草庐IT

Parse-server

全部标签

php - $_SERVER ['SERVER_NAME' ] 有什么好的替代品吗?

我在PHPdocpages上阅读了以下评论:"BewarnedthatmostcontentsoftheServer-Array(even$_SERVER['SERVER_NAME'])areprovidedbytheclientandcanbemanipulated.TheycanalsobeusedforinjectionsandthusMUSTbecheckedandtreatedlikeanyotheruserinput."然后我在这里看到了一个话题onStackOverflowsayingthat$_SERVER['SERVER_NAME']ispartlyservercon

php - $_SERVER ['document_root' ] 返回/htdocs 而不是/public_html

我想切换到一个新的主机,他们提供了这个漂亮的小“临时url”来在您切换之前测试您的文件。一切都很好,花花公子。所以我复制了我所有的文件。在每个页面的顶部,我需要来自服务器的另一个文件,该文件存储在public_html/includes/head.php。现在无论出于何种原因,$_SERVER['document_root']var返回/public_html/htdocs/includes/head.php(服务器上不存在)而不是/public_html/includes/head.php(确实存在).产生的错误如下:Warning:require_once(/home/secure

php - 并非所有 header 都在 $_SERVER [PHP] 中可用

我有一些自定义header,它在$_SERVER中不可见,但在帮助apache_request_headers()中可见。而且这种问题只存在于一个基于Windows的Apache版本(OpenServer)中。在Mac和Linux上,Apache将所有header传递给php,我可以在$_SERVER变量中看到它...也许对windows有一些限制?或者apache.conf中是否有任何设置可以激活将所有header传递给mod_php? 最佳答案 当PHP在Windows上作为Apache模块运行时,您不会在$_SERVER自动全

php - PHP函数parse_ini_file()真的有那么危险吗?

一些托管服务提供商禁用了PHP函数parse_ini_file()。任何在那里使用它的尝试都将失败,并显示错误“parse_ini_file()出于安全原因已被禁用”。这种配置是如此普遍,以至于作为最流行的CMS之一的Joomla避免直接使用parse_ini_file()而是将任务分为两步:使用file_get_contents()读取文件内容使用parse_ini_string()解析值,这是奇怪的允许,因此不被视为安全风险(WTF?)我的问题是,如何使用parse_ini_file()可以被视为安全威胁,或者如何禁用PHP函数parse_ini_file()可以提高安全性?会不会

php - Symfony 应用程序 403 禁止错误 : You don't have permission to access/on this server

我试图在CentOS7linode服务器上运行symfony应用程序,但出现错误:Cannotservedirectory:NomatchingDirectoryIndex(index.html,index.php)我用这个配置为这个子域设置了一个虚拟主机:ServerAdminpak11273@gmail.comServerNamemisterServerAliasproject.mystuff.comDocumentRoot/var/www/html/projectErrorLog/var/www/html/project/logs/error.logCustomLog/var/w

php - 父级 : Received shutdown signal -- Shutting down the server

使用wampserver并收到此错误:Parent:Receivedshutdownsignal--Shuttingdowntheserver.Google似乎没有任何有效的解决方案。有什么想法吗?[MonJul2519:07:022011][warn]NameVirtualHost*:80hasnoVirtualHosts[MonJul2519:07:022011][notice]Child5828:Childprocessisrunning[MonJul2519:07:022011][notice]Child5828:Acquiredthestartmutex.[MonJul251

php - 我不能在 PHP 类定义中使用 IF-THEN-ELSE 和 $_SERVER 变量

classMY_CONFIG{if($_SERVER["SERVER_ADDR"]=="127.0.0.1"){var$default=array('foo'=>1,'bar'=>2);}else{var$default=array('foo'=>3,'bar'=>4);}}我是PHP新手。我上面的代码有什么问题?系统一直说:解析错误:语法错误,意外的T_IF,期望在第4行的C:\wamp\www\test\class.php中有T_FUNCTION谢谢。--欣 最佳答案 类定义中的变量必须是静态的。如果你需要对它们应用逻辑,它应该

php - PHP : React or PHP's embedded server? 的替代 Web 服务器

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于StackOverflow来说是偏离主题的,因为它们往往会吸引自以为是的答案和垃圾邮件。相反,describetheproblem以及迄今为止为解决该问题所做的工作。关闭9年前。Improvethisquestion我一直将Apache用于我的PHP项目。但现在,我想离开它,开始使用以下选项之一:React或者PHP'sbuilt-inwebserver哪个性能更好?当然,什么是最好的?您推荐哪个?

php - PDOException : SQLSTATE[IMSSP]: Tried to bind parameter number 65536. SQL Server 最多支持2100个参数

好吧,我遇到了一个非常奇怪的PDOException,我似乎无法理解。这是生成的异常:PDOException:SQLSTATE[IMSSP]:Triedtobindparameternumber65536.SQLServersupportsamaximumof2100parameters.inD:\Work\CEUR16-004\Project\www_root\includes\scripts\php\libCore\products.php:169Stacktrace:#0D:\Work\CEUR16-004\Project\www_root\includes\scripts\p

php - parse_str 随机向键添加分号

我将查询字符串作为查询字符串的一部分传递给PHP脚本。有点像这样:$.post('/url',{id:postIDfilters:$('#form').serialize()});然后在我的PHP中,我使用parse_str读取filters:input->post('id');parse_str($this->input->post('filters'),$filters);问题是parse_str将;随机添加到键中。我得到这样的结果:array(4){["users"]=>string(0)""["companies;"]=>string(0)""["pref;_123"]=>st