草庐IT

T_OLD_FUNCTION

全部标签

php - 警告 : preg_match() [function. preg-match]:编译失败:在偏移处没有可重复的内容

我正在尝试将preg_match检查从url检查更改为用户名检查,这是可接受的最小/最大2-16chrs、破折号、空格和连字符。我收到这个错误Warning:preg_match()[function.preg-match]:Compilationfailed:nothingtorepeatatoffset14if(empty($string)||preg_match("#^([\w-]{2,16}*(?:.[\w-]{2,16}*)+):?(d+)?/?#i",$string))寻找URL的旧代码if(empty($string)||preg_match("#^(http|https

mysqli - PHP 错误 : "Call to undefined function mysqli_connect()"

在PHP中我得到这个错误:Calltoundefinedfunctionmysqli_connect()我检查了我的php.ini文件,extension=php_mysql.dll前面没有;或extension=php_mysqli.dll。我认为我收到此错误是因为我的配置文件(php.ini)路径是C:\Windows。我如何将其更改为C:\Apache2.2\php\php.ini? 最佳答案 在Ubuntu机器上你可以尝试:sudoapt-getinstallphp5-mysql因为基本的PHP5安装不包括mysqli_co

php - 易于获取 : Identify all old version numbers of a package?

我需要在Debian上安装PHP5.3。如果我要执行PHP的常规安装,我将获得5.4版。我知道我可以运行apt-getinstall=安装特定版本。但我不知道PHP5.3的确切包版本号是多少。我跑了apt-cacheshowpkgphp5和apt-cachemadisonphp5但他们只列出当前版本。如何确定用于安装PHP5.3的正确版本号? 最佳答案 我不知道它是否在某些apt命令中可用,但您可以在此处获得完整列表:http://snapshot.debian.org/package/php5/Debian的最新PHP5.3似乎是

php - 如何将参数传递给专门用于 register_shutdown_function 的可调用方法?

我有方法,在这个方法中可能会发生fatalerror,为了捕获这个错误我做了这个classa{functionshutDownFunction(){$error=error_get_last();if($error['type']==1){echo"thisisfatalerror";}}functionterribleFunction(){register_shutdown_function(array($this,'shutdownFunction'));//hereiscode,wichmaycausesfatalerror}}好的,这个明白了,但是我需要将参数从terrible

php - fatal error : Call to undefined function ldap_connect() in wamp

这个问题不太可能帮助任何future的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visitthehelpcenter.关闭9年前。希望有人能找出我哪里出错了,因为我到处转啊转,却找不到地方!我有一个WAMP5安装,它在WinXP机器上集成了PHP版本5.2.4、Apache/2.2.4(Win32)和MYSQL。一切正常,但我无法获得LDAP支持。我检查过extension_dir="c:/wamp/php/ext/"andextension=php_ldap.dllinphp.in

php - 警告 : session_start() [function. session 启动]:无法发送 session 缓存限制器 - header 已发送

这个问题在这里已经有了答案:"Cannotsendsessioncachelimiter-headersalreadysent"[duplicate](1个回答)关闭9年前。我的php代码收到类似这样的错误:Warning:session_start()[function.session-start]:Cannotsendsessioncachelimiter-headersalreadysent(outputstartedat/home4/iamden83/public_html/loop/signup.php:1)in/home4/iamden83/public_html/loop

IIS 上的 PHP 7 : Call_user_function could not be located

我正在尝试在Windows2012R264位服务器上将MicrosoftSQLServer驱动程序与PHP7.1非线程安全x64一起使用。无论我做什么,当我从管理员命令提示符运行php时,我都会收到错误Warning:PHPStartup:Unabletoloaddynamiclibrary'ext\php_pdo_sqlsrv_7_nts.dll'-Thespecifiedprocedurecouldnotbefound.此外,它还会弹出一个窗口,说明Theprocedureentrypointcall_user_functioncouldnotbelocatedinthedynam

php - 警告 : mkdir() [function. mkdir] : No such file or directory PHP?

尝试在PHP中使用mkdir()函数时出现此错误。基本上,我是在我的服务器上创建一个基于inputfield的HTML表单中名为(inPut)的sundomain。现在我正在尝试在该子域创建目录后创建它。所以我使用下面的代码:$subDomain=$_POST['inPut'];mkdir("$subDomain.mydoamin.com/newDirectory",0755);但我收到以下错误:Warning:mkdir()[function.mkdir]:Nosuchfileordirectoryinline99.第99行是这样的:mkdir("$subDomain.mydoami

php - fatal error : Uncaught ArgumentCountError: Too few arguments to function

我知道有一些与此相关的问题,但有C++或其他语言的问题。我得到这个错误,我不确定我的功能有什么问题。我的错误是这样的:Fatalerror:UncaughtArgumentCountError:ToofewargumentstofunctionUser::register(),2passedinC:\xampp\htdocs\register.phponline39andexactly5expectedinC:\xampp\htdocs\classes\users.php:22Stacktrace:#0C:\xampp\htdocs\register.php(39):User->reg

register_tick_function() 调用的 PHP debug_backtrace() 不返回完整堆栈

我想使用register_tick_function()Hook以下调用并使用debug_backtrace()打印它们的堆栈跟踪。如果我运行下面的代码。它只打印dump()函数。Functiondump()hasbeencalledFunctiondump()hasbeencalledFunctiondump()hasbeencalled为什么我没有看到print()和array_search()跟踪数据?这就像在调用dump()之前堆栈已被重置。我也很确定它在过去工作正常。 最佳答案 你误解了什么是回溯,这个堆栈不是PHP在到达