调用未定义的函数define() [英] Call to undefined function define()

查看:167
本文介绍了调用未定义的函数define()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WP网站上得到了很多

I'm getting this quite a lot on my WP site

PHP Fatal error:  Call to undefined function define() in index.php on line 14

该网站运行了几天(在某些情况下为几周),没有人碰过它,然后突然开始记录这些错误.

The site works for several days (weeks in some cases), no one touches it, and then it suddenly starts logging these errors.

这是Windows 2008 R2盒子. PHP崩溃了吗?我将如何进一步研究它.重新启动IIS可解决此问题.

It's a Windows 2008 R2 box. Has PHP fallen over? How would I go about looking into it further. Restarting IIS fixes the issue.

推荐答案

define是PHP的核心功能之一.由于代码的第14行是第一个函数调用,并且在该行上给出错误,因此,您的错误与define函数无关,并且任何函数调用都将出错.您可以通过在该行之前调用其他核心函数来简单地检查这种情况.

Well, define is one of the core functions of PHP. Since line 14 of your code is the first function call and it is giving error on that line, therefore, your error is not about define function and you would get error for any function call. You can simply check this scenario by calling other core functions before that line.

通过这一发现,我能够找到一些有关IIS中致命错误的相关问题.看来您的问题出在php.ini配置文件的二重奏上.请阅读以下解决方案:

By that finding, I was able to find a few related questions about fatal errors in IIS. It seems like your problem is duo to php.ini configuration file. Please read the following solutions:

  • Call to undefined function mysql_connect()
  • Call to undefined function ocilogon() - IIS 7.5 - Windows 2008 R2 x64 - PHP 7.2.7

如果有任何机会不起作用,可能是由于您的WP插件发生冲突.我不确定您安装了哪些插件,但是这里有一些相关主题可以为您提供帮助.您可能可以通过禁用一些插件来解决它:

If by any chance, that didn't work, it could be because of conflicts by your WP plugins. I'm not sure which plugins you have installed, but here are some related topics that could help you. You may be able to solve it by disabling some plugins:

  • https://buddypress.org/support/topic/getting-a-php-fatal-error-with-bp-core-functions/
  • https://wordpress.org/support/topic/fatal-error-3152/
  • https://wordpress.org/support/topic/php-fatal-error-enabling-paired-mode/

您应该意识到,在不了解有关PHP安装和WP配置的更多详细信息的情况下,确定问题确实非常困难.

You should realize that it is really hard to determine your problem without knowing more details about your PHP installation and WP configuration.

这篇关于调用未定义的函数define()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆