草庐IT

PATH_TWO_LEVELS_UP

全部标签

php - 在 ubuntu 14.04 上安装 Homestead 时“vagrant up”不起作用

我可靠地运行ubuntu14.04。为了能够使用laravel,我安装了virtualbox和vagrant。我通过git安装了laravelhomestead,我正在尝试运行命令“vagrantup”,但出现错误。请问我做错了什么?我尝试使用此命令“vagrantboxaddlaravel/homestead”添加vagrantbox,但出现以下错误:Anerroroccurredwhiledownloadingtheremotefile.Theerrormessage,ifany,isreproducedbelow.Pleasefixthiserrorandtryagain.SSL

apache - 什么可以改变 php.ini 和 PHP 文件之间的 include_path

我在系统上继承了一些我没有设置的代码,我在追踪PHP包含路径的设置位置时遇到了问题。我有一个包含以下include_path的php.ini文件include_path=".:/usr/local/lib/php"我在webroot中有一个名为test.php的PHP文件,其中包含以下phpinfo调用当我查看phpinfo调用时,include_path的本地值被覆盖了LocalValueMasterValueinclude_path.;C:\ProgramFiles\ApacheSoftwareFoundation\.:/usr/local/lib/phpApache2.2\pdc

php - 获取错误 "Below is a rendering of the page up to the first error."

我正在使用XMLWriter创建xml。下面是我的代码,它运行良好。openMemory();$writer->startDocument('1.0');$writer->setIndent(4);$writer->startElement('epp');$writer->startElement("command");$writer->startElement("login");$writer->writeElement('clID','hello');//username$writer->writeElement('pw','abcdefg');//password$writer-

php - Magento : Category Name instead of category ids in category path.

我正在尝试根据magento中的产品ID在类别路径中获取类别名称。假设我的产品ID=1,并且我在其中定义了category5(id=5),并且我得到了类似2/3/5的类别路径。我需要像category2/category3/category5这样的类别路径,而不是这种类型的类别路径。这意味着我需要路径中的类别名称而不是类别ID。我通过使用以下代码得到了这个但是它花费了很多时间。我需要减少处理时间。请就如何减少处理时间给我建议。$category_model=Mage::getModel('catalog/category');$product_model=Mage::getModel(

php - .htaccess 重写规则 : two domains using same server and directory

作为背景知识,我们有两个域:mydomain.commydomain.czmydomain.cz指向mydomain.com的服务器并使用相同的目录。我们在.htaccess(两个域共享)中有一个RewriteRule,如下所示:RewriteRule^([0-9]+)/?$project.php?id=$1[NC,L]#HandleprojectrequestsRewriteRule^([0-9]+)/?$project_cz.php?id=$1[NC,L]#Handleprojectrequests此RewriteRule在使用来自mydomain.com/project.php?

php - 检查 PHP 时间(H :i:s) reside between two times(H:i:s)

假设,$at_time='07:45:00';$ranges=[['start'=>'09:00:00','end'=>'17:00:00'],['start'=>'17:00:00','end'=>'08:59:00']];现在我想检查$ranges是否包含$at_time。 最佳答案 我的PHP有点生疏,但请尝试以下方法:$matches=Array();foreach($rangesas$i=>$ikey){if(strtotime($ranges[$i]['start'])strtotime($at_time)){array

php - 拉维尔 4 : Two different view pages for a single URI based on auth status

我最近开始使用Laravel4进行开发,我对路由有疑问。对于“/”,我希望根据用户的授权状态有两个不同的View页面。如果用户已登录并正在查看“/”,我想向他们展示一个带有管理控件的View,当用户在未登录的情况下以普通用户的身份查看“/”时,我想提供一个一般信息View。为了实现这一点,我一直在尝试使用过滤器“auth”和“guest”,但没有成功。//应用程序/routes.php//routeforloggedinusersRoute::get('/',array('before'=>'auth',function(){return'loggedin!';}));//fornor

php - Laravel,使用带有 PSR-4 的包给出消息 "No hint path defined for"

我正在使用Laravel4.1并启动一个使用PSR-4标准的包(subby)。当我尝试渲染任何View时:returnView::make('subby::user.login');我收到消息:Nohintpathdefinedfor[subby]我已经红色了很多东西,但那些通常是错字问题 最佳答案 问题出在PSR-4的使用上由于Laravel默认是PSR-0,它假定包的资源(View等)将比包服务提供者所在的位置高2级。例如:src├──config├──lang├──migrations├──Ghunti│  └──Subby│

php - FOSUserBundle - 如何在尝试访问 login_path 时重定向已经登录的用户

是否可以仅针对AUTHENTICATED的用户执行自动重定向到特定路由/login的某些路由(即/)?以及如何?我正在使用FOSUserBundle。这是我的安全配置:security:encoders:FOS\UserBundle\Model\UserInterface:sha512role_hierarchy:ROLE_ADMIN:ROLE_USERROLE_SUPER_ADMIN:ROLE_ADMINproviders:fos_userbundle:id:fos_user.user_provider.username_emailfirewalls:main:pattern:^/f

php - $_SERVER ['PATH_INFO' ] 在本地主机上

当我在本地主机上使用$_SERVER['PATH_INFO']时出现以下错误:Notice:Undefinedindex:PATH_INFO我正在使用WAMP。谁能告诉我为什么会这样? 最佳答案 PATH_INFO并不总是设置。仅当脚本后有尾随路径信息时才设置。例如,如果您有一个文件位于:localhost/index.php你可以通过这个url访问它:localhost/index.php/foo/bar然后$_SERVER['PATH_INFO']将被设置为“/foo/bar”的值但是如果您通过url:localhost/ind