PHP警告:模块已经在第0行载入未知

时间:2022-05-08 13:11:29

On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying)

在Mac OSX Mavericks中使用自制php55每当我运行一个php命令时,我就会得到下面的错误信息(一切运行良好,这很烦人)

PHP Warning:  Module 'intl' already loaded in Unknown on line 0

I ran

我跑

php --ini

and the output was

和输出是

php --ini
PHP Warning:  Module 'intl' already loaded in Unknown on line 0

Warning: Module 'intl' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.5/conf.d/ext-apcu.ini,
/usr/local/etc/php/5.5/conf.d/ext-igbinary.ini,
/usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-memcached.ini,
/usr/local/etc/php/5.5/conf.d/ext-mongo.ini,
/usr/local/etc/php/5.5/conf.d/ext-uuid.ini,
/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini

Checked in the php.ini file and the only place intl is loaded is at the top and it's commented out. The other files contents look something like:

检查在php。ini文件和唯一加载intl的地方是在顶部,它被注释掉了。其他文件内容如下:

extension="/usr/local/Cellar/php55/5.5.23/lib/php/extensions/no-debug-non-zts-20121212/intl.so"

where the contents after the last slash is the extension.

在最后一个斜杠后面的内容是扩展名。

I'm not sure where else to look.

我不知道还有什么地方可以看。

Any help is appreciated

任何帮助都是赞赏

8 个解决方案

#1


25  

I think you have loaded xdebug probably twice in php.ini.

我认为您已经在php.ini中加载了xdebug两次。

  1. check the php.ini, that you not have xdebug.so for the values extension= and zend_extension=.

    检查php。ini,你没有xdebug。因此对于值extension=和zend_extension=。

  2. Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in this directories the extension xdebug.so. Only one php.ini should load it.

    还要检查/etc/php5/apache2和/etc/php5/ clie2。不应该加载每个php。ini在此目录扩展xdebug.so。只有一个php。ini应该加载它。

#2


8  

I had the same issue on mac i.e. Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0. Here's how I solved it.

我在mac上也遇到了同样的问题,即警告:模块“pdo_pgsql”已经在第0行载入Unknown中。我是这样解的。

  • Locate the folder conf.d, mine was in the directory /usr/local/etc/php/7.0/conf.d.
  • 找到文件夹conf.d,我的文件夹在目录/usr/local/etc/php/7.0/conf.d。
  • In this folder, there's a file called ext-pdo_pgsql.ini.
  • 在这个文件夹中,有一个名为ext-pdo_pgsql.ini的文件。
  • Type sudo nano ext-pdo_pgsql.ini to edit it.
  • sudo纳米ext-pdo_pgsql类型。ini编辑它。
  • There should be a line extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so". Comment it out by adding semi-colon to the beginning of the line i.e. ;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so".
  • 应该有行扩展=“/usr/local/opt/php70- pgsql/pdo_pgsql.so”。在行首添加分号,比如;extension="/usr/local/opt/php70- pgsql/pdo_pgsql.so"
  • Save the file. (I usually run control + O, control + M).
  • 保存文件。(我通常运行control + O, control + M)。
  • Exit the file (control + X).
  • 退出文件(控件+ X)。

Hope this helps someone.

希望这可以帮助别人。

#3


1  

You should have a /etc/php2/conf.d directory (At least on Ubuntu I do) containing a bunch of .ini files which all get loaded when php runs. These files can contain duplicate settings that conflict with settings in php.ini. In my PHP installation I notice a file conf.d/20-intl.ini with an extension=intl.so setting. I bet that's your conflict.

你应该有/etc/php2/conf。d目录(至少在Ubuntu中是这样)包含了一堆的.ini文件,这些文件都是在php运行时加载的。这些文件可以包含与php.ini中的设置冲突的重复设置。在我的PHP安装中,我注意到一个文件conf.d/20-intl。ini = intl延伸。所以设置。我打赌那是你的冲突。

#4


0  

There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines. if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI. Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....

有两个“php_intl。dll”内的php文件。ini文件编号为872和968。如果php警告模块“intl”已经在第0行加载了,那么该消息将集中在您的CLI上。然后必须删除第872行上的分号前缀。我希望这事能成功……

#5


0  

I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7). After investigation, I found that /etc/php.d/ had two different .ini files loading extension=geoip.so.

在从Fedora Server 24 (PHP 5)升级到25 (PHP 7)之后,我也遇到了同样的问题d/有两个不同的.ini文件加载扩展名=geoip.so。

Previous version of distros had this file named 50-geoip.ini but the recent was changed to 40-geoip.ini, and I suspect that in the version-upgrade process the old hasn't been removed, while the new one has been created.

以前版本的发行版有这个名为50-geoip的文件。但最近的改成了40岁。在版本升级过程中,旧的没有被删除,而新的已经被创建。

That was the actual case of the issue. After removing stray 50-geoip.ini from /etc/php.d/ and restarting httpd it just worked flawlessly.

这就是问题的实际情况。删除后流浪50-geoip。ini从/etc/php.d/并重新启动httpd,它只是完美地工作。

#6


0  

To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your ini file may look like the lines below:

要解决这个问题,必须编辑php。ini(或extensions.ini)文件和推荐——已经包含的扩展名。例如,在编辑之后,ini文件可能看起来像下面的行:

;extension=pcre.so
;extension=spl.so

Source: http://www.somacon.com/p520.php

来源:http://www.somacon.com/p520.php

#7


0  

I deleted the 20-mongo.ini file in /etc/php5/cli/conf.d and this solved the problem.

我删除了20-mongo。ini文件/etc/php5/cli/conf.这就解决了问题。

#8


0  

In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.

在我的例子中,我有一个uncoment;extension=php_curl。所以在php。但是Ubuntu已经在别的地方调用这个扩展了。

To find this "somewhere else", on php.ini will informe. On my case: /etc/php/7.1/apache2/conf.d/20-curl.ini was the path.

要在php中找到这个“其他地方”。ini informe。我的情况:/etc/php/7.1/apache2/conf.d/20-curl.ini的路径。

So now we edit this file (terminal):

现在我们编辑这个文件(终端):

sudo nano /etc/php/7.1/apache2/conf.d/20-curl.ini

Comment the ;extension=php_curl.so

评论;扩展= php_curl.so

Save file and restart apache:

保存文件并重新启动apache:

sudo systemctl restart apache2

#1


25  

I think you have loaded xdebug probably twice in php.ini.

我认为您已经在php.ini中加载了xdebug两次。

  1. check the php.ini, that you not have xdebug.so for the values extension= and zend_extension=.

    检查php。ini,你没有xdebug。因此对于值extension=和zend_extension=。

  2. Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in this directories the extension xdebug.so. Only one php.ini should load it.

    还要检查/etc/php5/apache2和/etc/php5/ clie2。不应该加载每个php。ini在此目录扩展xdebug.so。只有一个php。ini应该加载它。

#2


8  

I had the same issue on mac i.e. Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0. Here's how I solved it.

我在mac上也遇到了同样的问题,即警告:模块“pdo_pgsql”已经在第0行载入Unknown中。我是这样解的。

  • Locate the folder conf.d, mine was in the directory /usr/local/etc/php/7.0/conf.d.
  • 找到文件夹conf.d,我的文件夹在目录/usr/local/etc/php/7.0/conf.d。
  • In this folder, there's a file called ext-pdo_pgsql.ini.
  • 在这个文件夹中,有一个名为ext-pdo_pgsql.ini的文件。
  • Type sudo nano ext-pdo_pgsql.ini to edit it.
  • sudo纳米ext-pdo_pgsql类型。ini编辑它。
  • There should be a line extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so". Comment it out by adding semi-colon to the beginning of the line i.e. ;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so".
  • 应该有行扩展=“/usr/local/opt/php70- pgsql/pdo_pgsql.so”。在行首添加分号,比如;extension="/usr/local/opt/php70- pgsql/pdo_pgsql.so"
  • Save the file. (I usually run control + O, control + M).
  • 保存文件。(我通常运行control + O, control + M)。
  • Exit the file (control + X).
  • 退出文件(控件+ X)。

Hope this helps someone.

希望这可以帮助别人。

#3


1  

You should have a /etc/php2/conf.d directory (At least on Ubuntu I do) containing a bunch of .ini files which all get loaded when php runs. These files can contain duplicate settings that conflict with settings in php.ini. In my PHP installation I notice a file conf.d/20-intl.ini with an extension=intl.so setting. I bet that's your conflict.

你应该有/etc/php2/conf。d目录(至少在Ubuntu中是这样)包含了一堆的.ini文件,这些文件都是在php运行时加载的。这些文件可以包含与php.ini中的设置冲突的重复设置。在我的PHP安装中,我注意到一个文件conf.d/20-intl。ini = intl延伸。所以设置。我打赌那是你的冲突。

#4


0  

There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines. if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI. Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....

有两个“php_intl。dll”内的php文件。ini文件编号为872和968。如果php警告模块“intl”已经在第0行加载了,那么该消息将集中在您的CLI上。然后必须删除第872行上的分号前缀。我希望这事能成功……

#5


0  

I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7). After investigation, I found that /etc/php.d/ had two different .ini files loading extension=geoip.so.

在从Fedora Server 24 (PHP 5)升级到25 (PHP 7)之后,我也遇到了同样的问题d/有两个不同的.ini文件加载扩展名=geoip.so。

Previous version of distros had this file named 50-geoip.ini but the recent was changed to 40-geoip.ini, and I suspect that in the version-upgrade process the old hasn't been removed, while the new one has been created.

以前版本的发行版有这个名为50-geoip的文件。但最近的改成了40岁。在版本升级过程中,旧的没有被删除,而新的已经被创建。

That was the actual case of the issue. After removing stray 50-geoip.ini from /etc/php.d/ and restarting httpd it just worked flawlessly.

这就是问题的实际情况。删除后流浪50-geoip。ini从/etc/php.d/并重新启动httpd,它只是完美地工作。

#6


0  

To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your ini file may look like the lines below:

要解决这个问题,必须编辑php。ini(或extensions.ini)文件和推荐——已经包含的扩展名。例如,在编辑之后,ini文件可能看起来像下面的行:

;extension=pcre.so
;extension=spl.so

Source: http://www.somacon.com/p520.php

来源:http://www.somacon.com/p520.php

#7


0  

I deleted the 20-mongo.ini file in /etc/php5/cli/conf.d and this solved the problem.

我删除了20-mongo。ini文件/etc/php5/cli/conf.这就解决了问题。

#8


0  

In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.

在我的例子中,我有一个uncoment;extension=php_curl。所以在php。但是Ubuntu已经在别的地方调用这个扩展了。

To find this "somewhere else", on php.ini will informe. On my case: /etc/php/7.1/apache2/conf.d/20-curl.ini was the path.

要在php中找到这个“其他地方”。ini informe。我的情况:/etc/php/7.1/apache2/conf.d/20-curl.ini的路径。

So now we edit this file (terminal):

现在我们编辑这个文件(终端):

sudo nano /etc/php/7.1/apache2/conf.d/20-curl.ini

Comment the ;extension=php_curl.so

评论;扩展= php_curl.so

Save file and restart apache:

保存文件并重新启动apache:

sudo systemctl restart apache2