Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

warning - Message

Important notice: This wiki is scheduled to be disabled in 2021. We are in the process of migrating content to the official documentation on docs.typo3.org. If you find information here that is missing from the official documentation, please feel free to get in contact with us on TYPO3 Slack (Channel: #t3docs-sig-wiki-migration).

Php.ini

From TYPO3Wiki
Jump to navigation Jump to search

{draft}

error - This page is a candidate for deletion

Reason: No reason given

If you disagree with its deletion, please explain why at Category talk:Candidates for speedy deletion or improve the page and remove the {{delete}} tag.

This notice should remain for a minimum of 1 week after it was placed on the page. If a discussion is still ongoing, it should remain until a consensus is reached or a decision has been made about the removal, after which the page will either be deleted or this notice removed.

Remember to check what links here and the the page history before deleting.

How to find the php.ini file

General

The most simple and portable way to find the php.ini file that's actually being used is to use phpinfo().

Since there may be more than one file named info.php, this avoids the case where you edit a info.php that is not really used by PHP.

Be aware that the settings in php.ini usually apply to all PHP processes. You can configure this per vhost, but it requires manual work. So whatever you do to your php.ini file, will apply to ALL other apps, websites and projects that also run on this computer / server and use the same PHP version.

Howto

Create a file in your web root (for example info.php) with this content:

<?php phpinfo();

Now open this page in your browser, and look for the line Configuration File (php.ini) Path in the first block of output telling you which php.ini is loaded.


Unix

Using find

You can use the find program to find all the php.ini files on your system.

find / -name "php.ini"

Using locate

You can use the locate program to find all the php.ini files in the locate database (which may not always be up to date).

locate php.ini

Conventional locations

As with most configuration files, php.ini should reside in /etc.

Gentoo

Example locations:

  • /etc/php/apache2-php5.2/php.ini
  • /etc/php/apache2-php5.3/php.ini
  • /etc/php/cgi-php5.3/php.ini
  • /etc/php/cli-php5.3/php.ini
  • /etc/php/fpm-php5.3/php.ini