草庐IT

register_extensions

全部标签

php - PHP的spl_autoload_register是如何解决与require_once的循环依赖的?

PHP的spl_autoload_register是如何解决与require_once的循环依赖的?循环依赖可以解决一些情况,但不是全部。让我们从一个失败的例子开始。假设我们在不同的文件中定义了三个类:cat.phpclassCatextendsAnimal{}animal.phprequire_once('cat.php');classAnimalextendsCreature{}creature.phpclassCreature{}假设我们还有一个具有自动加载器并创建Animal实例的脚本:run.phpspl_autoload_register(function($classNa

php - Composer 更新 : The requested PHP extension ext-http missing

我正在使用symfony框架和composer创建一个php网站。操作系统:Windows10PHP版本:7.3.2Symfony:4.2.3(环境:开发,调试:真)Composer:1.8.4(2019-02-11)当我尝试在项目文件夹中执行composeupdate时,或者当我尝试使用composerrequiresymfony/swiftmailer-bundle安装包时,我收到以下错误:Yourrequirementscouldnotberesolvedtoaninstallablesetofpackages.Problem1-TherequestedPHPextensione

php - New Relic warning : the Xdebug extension prevents the New Relic agent from gathering errors. 不会记录任何错误

在我的服务器上的/var/log/newrelic/php_agent.log中,我看到这样的行:2013-08-3016:05:01.444(15615/child)warning:theXdebugextensionpreventstheNewRelicagentfromgatheringerrors.Noerrorswillberecorded.然而,我仍然在NewRelic中看到[至少一些]PHP错误。这是怎么回事?这个警告是NewRelic中的错误吗?我还找到了this其中说:Ifyouareusingxdebug,youwillhaveawarningaboutthis.S

php - 我不能在 Twig_Extension 类中将内部函数与 Twig_SimpleFilter 一起使用

我有一个使用Symfony2的基于Twig的项目。由于Symfony2的特性,使用了命名空间。因此,我无法在命名空间之外提供全局函数。这是我的Twig扩展类:newTwig_SimpleFilter('shortKey','myCustomFilterFunction'));}publicfunctionmyCustomFilterFunction(){//codehere...}结果:FatalErrorException:错误:调用未定义函数myCustomFilterFunction()为什么:因为,Twig试图找到这个函数,但它在一个类中。如果这次我将它移到类之外,我将面临命名

php - register_shutdown_function 覆盖

是否可以覆盖已经设置的register_shutdown_function堆栈?像这样的东西:functionf1(){echo"f1";}functionf2(){echo"f2";}register_shutdown_function("f1");echo"actionshere";register_shutdown_function("f2");call_to_undefined_function();//to"produce"theerror在这种情况下,我希望脚本只调用f2()。这可能吗? 最佳答案 你不能直接做,但总有一

PHP fatal error : Call to undefined function session_register()

这个问题在这里已经有了答案:Fatalerror:Calltoundefinedfunctionsession_register()(3个答案)关闭3年前。我已经将我的站点从php5.3移动到5.4,现在我无法登录站点管理我看到这个错误:PHPfatalerror:调用/home/regimhot/public_html/webmotionsV4/mvc/models/kit_model_useri.php中的未定义函数session_register()第18行有问题的代码是:functionlogin($username,$password){if(!$username||!$pa

php - 安装 Phalcon PHP Devtools : "ERROR: Phalcon extension isn' t installed . ..虽然安装了模块

几天前我安装了PhalconPHP,我对它越来越兴奋了。现在我想试用PhalconDevtools。我刚刚像在installationmanualviaComposer中一样安装了它(对于Linux)显示。但是当我尝试执行phalcon命令时,出现错误:$phalconcommandsERROR:Phalconextensionisn'tinstalled,followtheseinstructionstoinstallit:http://docs.phalconphp.com/en/latest/reference/install.html可能是什么问题?(环境:DebianGNU/

php - 安装 php-xml 和 php-xml7.0 后 Ubuntu 14.04 上的 Pear 错误 "XML Extension not found"

我想使用pecl命令将redis安装到我在Ubuntu14.04上的php。但是我的Pear给了我一个警告列表:Warning:Invalidargumentsuppliedforforeach()inCommand.phponline249Warning:Invalidargumentsuppliedforforeach()in/usr/share/php/PEAR/Command.phponline249Warning:Invalidargumentsuppliedforforeach()inCommand.phponline249Warning:Invalidargumentsu

php - 让 APC 与 spl_autoload_register 配合使用

我正在使用ZendAutoloader加载Zend类,以便将Zend_AMF与我的应用程序集成。在我安装并启用APC3.1.9之前,一切都运行良好。我收到这个错误:Fatalerror:Accesstoundeclaredstaticproperty:Zend_Loader_Autoloader::$_instanceinC:\blahblah我假设APC似乎在自动加载器、静态属性和静态方法方面存在问题。APC是3.1.9版,安装在Windows7机器上,PHP5.3.8在Apache2.2服务器上作为fastCGI运行。有没有人见过这个错误?如果是这样,有什么方法可以解决这个问题?

php - 如何在 PHP 中覆盖 register_argc_argv?

我使用的是共享主机(fasthostingdirect),出于某种原因,他们默认关闭了此标志。这意味着我无法访问PHP命令行参数...除非我在之后使用-n(=--no-php-info)标志php.exe.在我的php文件中尝试了ini_set('register_argc_argv',1)但它没有效果。我猜这是由于托管服务提供商的限制性质,但是他们不会停止-n选项-虽然不确定使用它的其他含义。有没有人有更好的建议? 最佳答案 无需创建全新的ini文件,只需使用-d标志php-dregister_argc_argv=1myscrip