Home > Backend Development > PHP Tutorial > Where is my php.ini file for command-line PHP?

Where is my php.ini file for command-line PHP?

Susan Sarandon
Release: 2024-11-30 20:23:13
Original
519 people have browsed it

Where is my php.ini file for command-line PHP?

Locating php.ini for Command Line Use

When attempting to enable extensions for PHP in a command line environment, it's essential to locate the correct php.ini file. Unlike EasyPHP's graphical interface, the CLI requires a specific approach to find this file.

To resolve this issue, execute the following command in your terminal:

php --ini
Copy after login

The output will display various information, including the location of the php.ini file used by the CLI. Look for the line that says "Loaded Configuration File" and the path listed beside it. That is the php.ini you need to adjust, allowing you to enable extensions like pdo_mysql for your command line scripts.

The above is the detailed content of Where is my php.ini file for command-line PHP?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template