[英]PHP Warning: Module already loaded in Unknown on line 0
On Mac OSX Mavericks using homebrew php55 whenever I run aa php command I get the following error message (everything runs fine it's just annoying)在使用自制 php55 的 Mac OSX Mavericks 上,每当我运行 aa 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.签入 php.ini 文件,加载 intl 的唯一位置在顶部,并且已被注释掉。 The other files contents look something like:
其他文件内容类似于:
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任何帮助表示赞赏
I think you have loaded Xdebug probably twice in php.ini
.我认为您在
php.ini
中可能已经加载了两次Xdebug 。
check the php.ini
, that not have set xdebug.so
for the values extension=
and zend_extension=
.检查
php.ini
,它没有为值extension=
和zend_extension=
设置xdebug.so
。
Check also /etc/php5/apache2
and /etc/php5/cli/
.还要检查
/etc/php5/apache2
和/etc/php5/cli/
。 You should not load in each php.ini
in these directories the extension xdebug.so
.您不应在这些目录中的每个
php.ini
中加载扩展名xdebug.so
。 Only one file, php.ini
should load it.只有一个文件,
php.ini
应该加载它。
Note: Inside the path is the string /etc/php5
.注意:路径里面是字符串
/etc/php5
。 The 5 is the version of PHP. 5是PHP的版本。 So if you use another version, you always get a different path, like
php7
.所以如果你使用另一个版本,你总是会得到一个不同的路径,比如
php7
。
I had the same issue on mac ie Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0
.我在 mac 上遇到了同样的问题,即
Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0
。 Here's how I solved it.这是我解决它的方法。
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
目录中。ext-pdo_pgsql.ini
.ext-pdo_pgsql.ini
的文件。sudo nano ext-pdo_pgsql.ini
to edit it.sudo nano ext-pdo_pgsql.ini
进行编辑。extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so"
.extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so"
。 Comment it out by adding semi-colon to the beginning of the line ie ;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so"
.;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so"
。 Hope this helps someone.希望这可以帮助某人。
To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in.要解决此问题,您必须编辑 php.ini(或 extensions.ini)文件并注释掉已编译的扩展。 For example, after editing, your ini file may look like the lines below:
例如,编辑后,您的 ini 文件可能如下所示:
;extension=pcre.so
;extension=spl.so
Source: http://www.somacon.com/p520.php来源:http: //www.somacon.com/p520.php
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.你应该有一个/etc/php2/conf.d目录(至少在 Ubuntu 上是这样),其中包含一堆 .ini 文件,这些文件在 php 运行时都会被加载。 These files can contain duplicate settings that conflict with settings in
php.ini
.这些文件可能包含与
php.ini
中的设置冲突的重复设置。 In my PHP installation I notice a file conf.d/20-intl.ini
with an extension=intl.so
setting.在我的 PHP 安装中,我注意到一个带有
extension=intl.so
设置的文件conf.d/20-intl.ini
。 I bet that's your conflict.我敢打赌那是你的冲突。
In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.在我的例子中,我取消了 php.ini 中的 ;extension=php_curl.so 的注释,但是 Ubuntu 已经在其他地方调用了这个扩展。
To find this "somewhere else", on php.ini will informe.要找到这个“其他地方”,在 php.ini 上会通知。 On my case: /etc/php/7.1/apache2/conf.d/20-curl.ini was the path.
就我而言: /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评论 ;extension=php_curl.so
Save file and restart apache:保存文件并重新启动 apache:
sudo systemctl restart apache2
For issue related to code igniter project upload,
go to the base directory index.php and add this code:
if ($_SERVER['SERVER_NAME'] == 'local_server_name') {
define('ENVIRONMENT', 'development');
} else {
define('ENVIRONMENT', 'production');
}
if (defined('ENVIRONMENT')){
switch (ENVIRONMENT){
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
对于共享主机,在 cPanel 中,我在“选择 PHP 版本”>“扩展”下取消选中有问题的模块,PHP 7.4 的错误消失了。
I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7) .从Fedora Server 24 (PHP 5)升级到 25 (PHP 7)后,我遇到了同样的问题。 After investigation, I found that
/etc/php.d/
had two different .ini
files loading extension=geoip.so
.经过调查,我发现
/etc/php.d/
有两个不同的.ini
文件加载extension=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.ini
但最近的已更改为40-geoip.ini
,我怀疑在版本升级过程中旧的尚未删除,而新的已创建.
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.从
/etc/php.d/
中删除杂散50-geoip.ini
并重新启动httpd
后,它就完美地工作了。
我删除了 /etc/php5/cli/conf.d 中的 20-mongo.ini 文件,这解决了问题。
I figured this out by printing the PHP configuration and searching by xml.ini.我通过打印 PHP 配置并通过 xml.ini 搜索来解决这个问题。 Notice in the following output how xml is loaded twice (first as 20-xml.ini and then as xml.ini):
请注意以下输出中 xml 是如何加载两次的(首先是 20-xml.ini,然后是 xml.ini):
$ php -i | grep xml
/etc/php.d/20-simplexml.ini,
/etc/php.d/20-xml.ini,
/etc/php.d/20-xmlwriter.ini,
/etc/php.d/30-xmlreader.ini,
/etc/php.d/xml.ini
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
libxml Version => 2.9.1
libxml
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text /|application/xhtml\+xml)
xml
libxml2 Version => 2.9.1
xmlreader
xmlwriter
libxslt compiled against libxml Version => 2.9.1
There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines.在 872 和 968 数字行的 php.ini 文件中有两个“php_intl.dll”文件。 if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI.
如果php 警告模块 'intl' 已经在第 0 行以未知方式加载,则此消息将集中在您的 CLI 上。 Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....
然后你应该删除第 872 行的半克隆前缀。我希望这会完成.....
Just for the record as it might help others who are on shared hosting (cPanel).仅作记录,因为它可能会帮助使用共享主机 (cPanel) 的其他人。
I had error on shared hosting php7.2: Module 'imagick' already loaded in Unknown on line 0我在共享主机 php7.2 上遇到错误:模块 'imagick' 已经加载到第 0 行的未知中
In the beginning hosting provider said it was my bad configuration (running Yii2.16).一开始托管服务提供商说这是我的错误配置(运行 Yii2.16)。 But after I showed them, that all Internet related this issue to server configuration -they started to listen to me.
但在我向他们展示之后,所有互联网都将这个问题与服务器配置相关联——他们开始听我的。 After I proved, that there was no error on php7.1 they started to search for the error.
在我证明了php7.1没有错误之后,他们开始搜索错误。
As they told to me - the error was due to configuration in PERL modules or PEAR package, but they did not told me the real issue.正如他们告诉我的那样 - 错误是由于 PERL 模块或 PEAR 包中的配置造成的,但他们没有告诉我真正的问题。
So, if you are on shared hosting - talk to you provider and experiment with PHP versions (if you can change them).因此,如果您在共享主机上 - 与您的提供商交谈并试用 PHP 版本(如果您可以更改它们)。
Comment out these two lines in php.ini
在
php.ini
中注释掉这两行
;extension=imagick.so
;extension="ixed.5.6.lin"
it should fix the issue.它应该解决这个问题。
在 Windows 10 中,我通过这样的评论来解决这个问题
;extension=php_sockets.dll
Run php --ini
and notice file path on Loaded Configuration File
.运行
php --ini
并注意Loaded Configuration File
上的文件路径。
Then run command like cat -n /etc/php/7.2/cli/php.ini | grep intl
然后运行
cat -n /etc/php/7.2/cli/php.ini | grep intl
类的命令cat -n /etc/php/7.2/cli/php.ini | grep intl
to find if the extension is commented or not. cat -n /etc/php/7.2/cli/php.ini | grep intl
查找扩展是否被注释。
Then update loaded configuration file by commenting line by adding ;
然后通过添加注释行更新加载的配置文件
;
such as ;extension=intl
比如
;extension=intl
This can happen when you install php-intl
package and also enable the same extension on php.ini
file.当您安装
php-intl
包并在php.ini
文件上启用相同的扩展时,可能会发生这种情况。
If you are on shared hosting, just apply the default php settings.如果您在共享主机上,只需应用默认的 php 设置。 Cpanel overrides php settings to default.
Cpanel 将 php 设置覆盖为默认值。
I am using WAMP in Windows 10 with PHP 7.2.10.我在带有 PHP 7.2.10 的 Windows 10 中使用 WAMP。 I was able to solve it through commenting the line
extension=ftp
in php.ini inside wamp64\bin\php\php7.2.10 .我能够通过在 wamp64\bin\php\php7.2.10 中的 php.ini 中注释行
extension=ftp
来解决它。
I am unsure but my guess why this happens is that my php.ini inside wamp64\bin\apache\apache2.4.35\bin already loads this module.我不确定,但我猜为什么会发生这种情况是我在 wamp64\bin\apache\apache2.4.35\bin 中的 php.ini 已经加载了这个模块。
Be sure to restart all services of WAMP after doing so.确保在这样做之后重新启动 WAMP 的所有服务。
I had the same issue so I commented the extension=mysqli
as I included this to run sql server.我遇到了同样的问题,所以我评论了
extension=mysqli
,因为我将它包含在运行 sql server 中。 Check if you have uncommented this extension=mysqli if so, place ;
检查你是否取消了这个 extension=mysqli 的注释,如果是,放置
;
in php.ini在 php.ini 中
我通过从extension=grpc 这样的评论中删除php.ini文件解决了这个问题;extension=grpc
通过评论 extension=curl 解决
I had a similar problem, the problem was that the extension intl was duplicated.我有一个类似的问题,问题是扩展名 intl 重复了。
You can check in file C:/xampp/php/php.ini and find "intl".您可以检查文件 C:/xampp/php/php.ini 并找到“intl”。 In my case extension=intl is already present and I scrolled again and found a second intl "extension=php_intl.dll".
在我的情况下,extension=intl 已经存在,我再次滚动并找到了第二个 intl“extension=php_intl.dll”。
The extension must one to execution can't execution extension intl again.扩展必须一个才能执行,不能再次执行扩展 intl。 This will show error like this "Module 'intl' already loaded".
这将显示类似“模块'intl'已加载”的错误。
I fixed it by commenting out extension=php_intl.dll
using " ;
" like this ;extension=php_intl.dll
.我通过使用“
;
”注释掉extension=php_intl.dll
来修复它,就像这样;extension=php_intl.dll
。 and restarted the apache service.并重新启动 apache 服务。
En mi caso, hola primero. En mi caso,你好初级。 Lo único que hice fue correr "composer clear-cache", esperar que terminara la ejecución.
Lo único que hice fue correr "composer clear-cache",esperar que terminara la ejecución。 Volver a correr el comando "composer init".
Volver a correr el comando “composer init”。 Con eso eliminé el error "Warning: Module "mysqli" is already loaded in Unknown on line 0"
Con eso eliminé el 错误“警告:模块“mysqli”已加载到第 0 行的未知中”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.