# Changing default php.ini file for PHP-CLI on CentOS

DevFeed: [Changing default php.ini file for PHP-CLI on CentOS](<https://devfeed.tech/articles/changing-default-php-ini-file-for-php-cli-on-centos-27620.md>)

Original publisher: [Read original article](<https://gagor.pro/2014/05/changing-default-php-ini-file-for-php-cli-on-centos/>)

Author: Tom

Published: 2014-05-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [centos](<https://devfeed.tech/topics/centos.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [centos](<https://devfeed.tech/tags/centos.md>), [cli](<https://devfeed.tech/tags/cli.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [linux](<https://devfeed.tech/tags/linux.md>), [php](<https://devfeed.tech/tags/php.md>), [script](<https://devfeed.tech/tags/script.md>)

## AI overview

This tutorial explains how to use a separate php.ini configuration for PHP scripts running in CLI mode on CentOS, instead of sharing the system-wide configuration used by Apache and FPM.

## Source excerpt

On Debian in default installation you have different configuration files for PHP in Apache, FPM, CLI, etc. But on CentOS you have only one php.ini for all of them. In case I have, I need to have different configuration file for scripts running in CLI mode (more memory, etc). I could run it like this: php -c /etc/php-cli.ini script.php But this a little burdensome. So I do it like this: