草庐IT

No_module_named

全部标签

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文件时突然出现此错误。我该如何解决这个问题?

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 - 教义 - [语义错误] - 错误 : Class has no field or association

我正在尝试使用Doctrine的DQL运行查询在存储库中,我收到以下错误:QueryExceptioninQueryException.phpline63:[SemanticalError]line0,col100near'test_suite_id':Error:ClassApplication\Model\Entity\Pagehasnofieldorassociationnamedtest_suite_id协会一个User可以有多个TestSuite。一个TestSuite可以有多个Page。因此,我在User和TestSuite以及TestSuite和Page分别。以下是我的实

php - 文件获取内容(): No such host is known error

我正在使用file_get_contents函数将URL转换为字符串:$contents=file_get_contents("http://google.com");但是,我收到以下错误:file_get_contents()[function.file-get-contents]:php_network_getaddresses:getaddrinfofailed:Nosuchhostisknown.如何在我的本地主机上解决这个问题? 最佳答案 您的“本地主机”无法将名称google.com解析为IP地址,这意味着您的机器无法/

php - Dompdf 错误 "No block-level parent found. Not good."

require_once("function/dompdf/dompdf_config.inc.php");$dompdf=newDOMPDF();foreach($modulesas$module){$output="Hello".$module['name'];$dompdf->load_html($output);$dompdf->render();$output_pdf=$dompdf->output();file_put_contents($dir.$name_modulo.".pdf",$output_pdf);}Fatalerror:Uncaughtexception'D

php - "E: Package ' php-soap ' has no installation candidate"on php :7. 0-fpm Docker 镜像。退出代码:100

我想标题说明了一切......我有一个来自php:7.0-fpm图像的容器集。在Dockerfile中,我运行apt-getupdate&&apt-getinstall-yphp-soap。但是,它失败并返回100作为退出代码。此外,还有E:Package'php-soap'hasnoinstallationcandidate。基于此discussion,我需要安装apt-transport-https。我把它安装在Dockerfile中,但仍然是同样的错误。我该怎么办? 最佳答案 FPM镜像源码自带php。当您运行apt-geti

php - Vagrant/Puppet --- 确保 : change from present failed: Could not set 'present on ensure: No such file or dir

我正在使用Vagrant和Puppet在Ubuntu上安装Apache和PHP。但是,我在vagrantup期间收到以下错误。我认为模板的路径是正确的,那为什么会出错呢?我正在使用设置here修改以确保apt-getupdate在任何其他操作之前运行错误←[1;35merr:/Stage[main]/Php/File[/etc/php5/apache2/apc.ini]/ensure:从缺席出席失败:无法设置“出席确保:没有这样的文件或目录ectory-/etc/php5/apache2/apc.ini.puppettmp_6187在/tmp/vagrant-puppet/module

php - Magento:获取 "disable module output"的值

Magento后端允许您禁用每个站点的模块输出。我做了一些谷歌搜索,但无法弄清楚如何通过我的代码获取这个值。基本上,当我的模块的输出被禁用时,它工作得很好。但我发现(困难的方法)Magento不会阻止模块按站点加载。因为我是在扩展一些核心类,一些构造器还在执行。我的想法是检查模块输出是否被禁用。如果是这样,让我的构造函数调用父的构造函数。如果启用了模块输出,则继续我的自定义代码。我只是不知道如何获取当前站点的这个值(顺便说一句,我是多站点的)。理想情况下应该是这样的:$isThisEnabled=Mage::app()->getCurrentStore()->isOutputEnabl

php - Magento : Get country code by country name

我试图通过国家名称查找国家代码。所以,例如,我有“荷兰”,我需要得到“NL”我知道有一种方法可以找到名称形式的代码:$country_name=Mage::app()->getLocale()->getCountryTranslation($country_code)但我需要反之亦然。那么Magento中有什么方法可以解决吗? 最佳答案 Fromtheotherquestion,这只能通过循环国家集合来完成$countryId='';$countryCollection=Mage::getModel('directory/count

php - 将 basename 函数与 $_FILES ['userFile' ] ['name' ] 一起使用不是多余的吗?

根据thePOSTmethoduploadssection的thePHPManual,$_FILES['userfile']['name']是客户端机器上文件的原始名称。该部分中的示例#2使用basename使用$_FILES['userfile']['name']的函数如下所示:$uploaddir='/var/www/uploads/';$uploadfile=$uploaddir.basename($_FILES['userfile']['name']);我在本地主机(Apache2.2.14、PHP5.3.1、WindowsXP)上做了一些实验,发现以下两行是等价的:$_FIL