如何看到PHP加载的扩展?

时间:2021-01-04 07:30:06

It's got to be somewhere in the phpinfo() dump, but I just don't know where. Is it supposed to be under the "Additional Modules" section? Somewhere else? I'm trying to figure out why some extensions don't appear to be loaded, but I don't even know where I should be looking.

它必须在phpinfo()转储文件的某个地方,但是我不知道在哪里。它应该在“附加模块”部分下吗?别的地方吗?我试图弄明白为什么有些扩展没有加载,但我甚至不知道应该在哪里查找。

7 个解决方案

#1


127  

Running

运行

php -m
will give you all the modules, and
php -i
will give you a lot more detailed information on what the current configuration.

#2


21  

Run command. You will get installed extentions:

运行命令。您将获得安装扩展:

php -r "print_r(get_loaded_extensions());"

Or run this command to get all module install and uninstall with version

或运行此命令以获得所有模块安装和卸载版本

dpkg -l | grep php5

#3


17  

get_loaded_extensions

get_loaded_extensions

#4


11  

You want to run:

你想要运行:

 php -m 

on the command line,

在命令行上,

or if you have access to the server configuration file open

或者如果您可以打开服务器配置文件

/etc/php5/apache2/php.ini

and look at all the the extensions,

看看这些扩展,

you can even enable or disable them by switching between On and Off like this

你甚至可以通过像这样的开关来启用或禁用它们

<Extension_name> = <[On | Off]>

#5


8  

  <?php 
      echo "<pre>";
      print_r(get_loaded_extensions());
      echo "<pre/>";
 ?>

#6


2  

get_loaded_extensions() output the extensions list.

get_loaded_extensions()输出扩展列表。

phpinfo(INFO_MODULES); output the extensions and their details.

phpinfo(INFO_MODULES);输出扩展及其细节。

#7


0  

Are you looking for a particular extension? In your phpinfo();, just hit Ctrl+F in your web browser, type in the first 3-4 letters of the extension you're looking for, and it should show you whether or not its loaded.

你在找特别的分机吗?在phpinfo()中,在web浏览器中按下Ctrl+F,输入要查找的扩展名的前3-4个字母,它应该显示它是否加载了。

Usually in phpinfo() it doesn't show you all the loaded extensions in one location, it has got a separate section for each loaded extension where it shows all of its variables, file paths, etc, so if there is no section for your extension name it probably means it isn't loaded.

通常在phpinfo()中,它不会在一个位置显示所有加载的扩展,它为每个加载的扩展都有一个单独的部分,它显示了所有的变量、文件路径等,所以如果没有为您的扩展名提供部分,它可能意味着它没有加载。

Alternatively you can open your php.ini file and use the Ctrl+F method to find your extension, and see if its been commented out (usually by a semicolon near the start of the line).

也可以打开php。ini文件和使用Ctrl+F方法找到你的扩展名,看看它是否被注释掉了(通常在行开头用分号)。

#1


127  

Running

运行

php -m
will give you all the modules, and
php -i
will give you a lot more detailed information on what the current configuration.

#2


21  

Run command. You will get installed extentions:

运行命令。您将获得安装扩展:

php -r "print_r(get_loaded_extensions());"

Or run this command to get all module install and uninstall with version

或运行此命令以获得所有模块安装和卸载版本

dpkg -l | grep php5

#3


17  

get_loaded_extensions

get_loaded_extensions

#4


11  

You want to run:

你想要运行:

 php -m 

on the command line,

在命令行上,

or if you have access to the server configuration file open

或者如果您可以打开服务器配置文件

/etc/php5/apache2/php.ini

and look at all the the extensions,

看看这些扩展,

you can even enable or disable them by switching between On and Off like this

你甚至可以通过像这样的开关来启用或禁用它们

<Extension_name> = <[On | Off]>

#5


8  

  <?php 
      echo "<pre>";
      print_r(get_loaded_extensions());
      echo "<pre/>";
 ?>

#6


2  

get_loaded_extensions() output the extensions list.

get_loaded_extensions()输出扩展列表。

phpinfo(INFO_MODULES); output the extensions and their details.

phpinfo(INFO_MODULES);输出扩展及其细节。

#7


0  

Are you looking for a particular extension? In your phpinfo();, just hit Ctrl+F in your web browser, type in the first 3-4 letters of the extension you're looking for, and it should show you whether or not its loaded.

你在找特别的分机吗?在phpinfo()中,在web浏览器中按下Ctrl+F,输入要查找的扩展名的前3-4个字母,它应该显示它是否加载了。

Usually in phpinfo() it doesn't show you all the loaded extensions in one location, it has got a separate section for each loaded extension where it shows all of its variables, file paths, etc, so if there is no section for your extension name it probably means it isn't loaded.

通常在phpinfo()中,它不会在一个位置显示所有加载的扩展,它为每个加载的扩展都有一个单独的部分,它显示了所有的变量、文件路径等,所以如果没有为您的扩展名提供部分,它可能意味着它没有加载。

Alternatively you can open your php.ini file and use the Ctrl+F method to find your extension, and see if its been commented out (usually by a semicolon near the start of the line).

也可以打开php。ini文件和使用Ctrl+F方法找到你的扩展名,看看它是否被注释掉了(通常在行开头用分号)。