PHP's configuration file location might differ from one platform to another. Here's an incomplete list of the possible location for PHP's configuration file;
Platform | Location |
---|---|
xampp | {installation directory}/php/php.ini |
macOS | /private/etc/php.ini |
Ubuntu < 16.10 | /etc/php5/{cli,apache2,cgi}/php.ini |
Ubuntu >= 16.10 | /etc/php7/{cli,apache2,cgi}/php.ini |
Ubuntu >= 18.04 | /etc/php/{version}/{cli,apache2,cgi}/php.ini |
RedHat/CentOS/Fedora | /etc/php.ini |
If you're on a Unix-based operating system, you can run php -i from the terminal and look for Loaded Configuration File from the output to get the location for your exact system, such as the following;
$ php -i | grep 'Loaded Configuration File' Loaded Configuration File => /etc/php.ini
Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Discuss the article:
Comment anonymously. Login not required.