Introduction
The `get_loaded_extensions()` function in PHP is used to return an array of all the extensions that are currently loaded in the PHP environment. However, if this function returns an empty array, it can be a sign of a problem with the PHP installation. This article will discuss the possible causes of this issue and how to resolve it.
Solution
The solution to this problem is to enable the PHP extensions in the php.ini file. To do this, open the php.ini file and locate the line that reads “;extension=”. Remove the semicolon from the beginning of the line and save the file. Then, restart the web server for the changes to take effect. After doing this, running the function get_loaded_extensions() should show the list of enabled extensions.
This function returns an array.
print_r(get_loaded_extensions());
solved `get_loaded_extensions()` shows nothing in PHP [closed]
If you are having trouble getting get_loaded_extensions()
to show anything in PHP, the solution is quite simple. The problem is likely that you have not enabled the necessary extensions in your php.ini file. To do this, open your php.ini file and look for the line that says extension=
. Then, add the names of the extensions you want to enable, separated by commas. For example, if you want to enable the MySQL and GD extensions, you would add extension=mysql,gd
to the line. Once you have done this, save the file and restart your web server. After that, get_loaded_extensions()
should show the extensions you enabled.