How to Locate php.ini and List Enabled PHP Extensions

This article explains two methods to locate the php.ini file and view installed PHP extensions—using a simple PHP script with phpinfo() and the command‑line tools php -m and php --ini—while also promoting a PHP online training class with enrollment details.

php Courses
php Courses
php Courses
How to Locate php.ini and List Enabled PHP Extensions

Purpose : Show how to check which PHP extensions are enabled and locate the php.ini configuration file.

Simple method : Create a directory with an index.php containing <?php echo phpinfo(); ?>, start a built‑in server with php -S localhost:2233, and open http://localhost:2233 in a browser to view the configuration.

Recommended method : Use the command php -m to list all loaded modules quickly.

Example output includes modules such as bcmath, curl, date, etc.

Finding the php.ini path : Run php --ini which prints the configuration file path, the loaded php.ini file, and directories for additional .ini files.

Typical output shows Configuration File (php.ini) Path: /usr/local/etc/php/8.1 and Loaded Configuration File: /usr/local/etc/php/8.1/php.ini.

Tips : The article also advertises the “PHP中文网” online training class (第23期PHP线上培训班) with contact details (WeChat, QQ) and describes the teaching format, homework review, resource download, and job referral support.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend DevelopmentPHPCommand Linephp-ini
php Courses
Written by

php Courses

php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.