草庐IT

File_Name

全部标签

php - Apache + PHP : how to change the value of $_SERVER ['SERVER_NAME' ] in apache?

例如,我有mysite.com和beta.mysite.com。两者都使用virtualHost指令指向同一个索引文件。我将在apacheconf中做什么,以便当我访问$_SERVER['SERVER_NAME']时,该值仍然是mysite.com?这应该是灵活的,只有beta会被删除。 最佳答案 也许您可以在VirtualHost指令中使用ServerAlias,并且只使用一个VirtualHost指令:ServerNamemysite.comServerAliasbeta.mysite.com...

php - 本地主机上的目录名(__FILE__)

我正在使用WAMP并在www目录中有一个开发站点。我想使用dirname(__FILE__)来定义服务器根目录的路径。目前我使用的配置文件包含:define('PATH',dirname(__FILE__));我将配置文件包含在我的header.php文件中,如下所示:然后,在我的子页面上,我使用常量PATH通过包含header.php来定义路径。但是,我的链接是这样出来的:我需要做什么来解决这个问题?因为我在header.php文件中包含了我的常量,所以我无法访问初始require_once("../inc/header.php");中的常量。还有什么方法可以找到header.php

PHP 警告 : file_get_contents failed to open stream: HTTP request failed! HTTP/1.1 400 错误请求

我已经使用Codeigniter构建了一个本地DVD数据库,其中包含电影名称等。我想要做的是从thisIMDBAPI加载更多电影数据。.但是我收到以下错误:APHPErrorwasencounteredSeverity:WarningMessage:file_get_contents(http://www.imdbapi.com/?i=&t=2Fast2Furious)[function.file-get-contents]:failedtoopenstream:HTTPrequestfailed!HTTP/1.1400BadRequestFilename:controllers/dv

php - Form::file:如何在验证错误后和/或更新时使用 Input::old 重新填充?

在我的PhotosController中,我试图修改编辑操作,以便它在Form::file()输入字段中显示现有值(并且,如果验证失败,它会重新填充该字段)。if($validation->passes()){//savestheimageontheFSandupdatesthedbentry}returnRedirect::route('photos.edit')->withInput(Input::all())->withErrors($validation)->with('message','Therewerevalidationerrors.');上传过程正常,但当我查看现有记

php - 如何在 Laravel 5.0 中获取上传文件的 tmp_name

使用Laravel5,我一直在尝试获取上传的文件并使用文件系统外观移动它,以从Laravel使用的flysystem功能中获利。问题是,即使我尝试获取路径、tmp_name、磁盘名或代表$_FILES[file][tmp_name]的任何属性,我似乎也无法访问它!我不想使用$_FILES,因为它违反了最佳实践,如果要更改某些内容,它将不再起作用,所以我真的想使用:$request->file('import')访问我导入的文件。UploadedFile类中有一个move方法,但我需要设置一个本地路径,但情况并非如此。然后在FileSystem契约(Contract)中有一个移动方法,但

php - 严重性 : 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

严重性:8192消息:在未来的PHP版本中,与类同名的方法将不再是构造函数;CI_Pagination有一个已弃用的构造函数文件名:libraries/Pagination.php行号:27classCI_Pagination{var$base_url='';//Thepagewearelinkingtovar$total_rows='';//Totalnumberofitems(databaseresults)var$per_page=10;//Maxnumberofitemsyouwantshownperpagevar$num_links=2;//Numberof"digit"li

php - Windows 更新警告 : Unknown: failed to open stream: No such file or directory in Unknown on line 0

Warning:Unknown:failedtoopenstream:NosuchfileordirectoryinUnknownonline0Fatalerror:Unknown:Failedopeningrequired'C:/School/OneDrive-Noorderpoort/PHP/htdocs/Jaar1/Blok1/Les7/oefening16.php'(include_path='C:\xampp\php\PEAR')inUnknownonline0经过长时间的Windows更新后,当我尝试通过本地主机打开php文件时突然出现此错误。我该如何解决这个问题?

带有密码保护 url 的 php simplexml_load_file()

知道答案的人的简单问题...$xml=simplexml_load_file("http://url/path/file.xml");此url受.htaccess保护,如何将登录名/密码作为参数传递给函数? 最佳答案 $xml=simplexml_load_file("http://username:password@url/path/file.xml");试试看:) 关于带有密码保护url的phpsimplexml_load_file(),我们在StackOverflow上找到一个类似

PHP 评估后的 PHP file_get_contents

我知道如何使用file_get_contents和fopen等,但是当我对自己的文件之一执行此操作时,我得到的是文字字符串,也就是说,代码没有经过预处理!我如何在不使用require等的情况下从文件中导入文本,因为我想将值存储到字符串中 最佳答案 参见themanual上的示例#5和#6.直接从那里获取:$string=get_include_contents('somefile.php');functionget_include_contents($filename){if(is_file($filename)){ob_start

php - file_get_contents 对 'https://en.wikipedia.org/wiki/Category:Upcoming_singles' 的变量响应

file_get_contents('https://en.wikipedia.org/wiki/Category:Upcoming_singles');使用Chrome网络浏览器访问同一地址(显示4种产品)返回不同的响应(2种产品)。经检查,我怀疑这可能与有关Savedinparsercachekeywith...timestamp...在返回的html中。当我使用file_get_contents()时,时间戳较旧关于如何使用file_get_contents()获取最新信息有什么想法吗?谢谢! 最佳答案 假设file_get_