Questions tagged [php-ini]

PHP.ini is very useful and it is a configuration file that is used to customize behavior of PHP at runtime.

The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation.

php.ini documentation.

You can change the settings in your web server configuration with php_flag, php_admin_value and php_admin_flag as well.

In case of Apache server some configuration settings can be changed using .htaccess files, but the usage is restricted to php_flag.

Related tags:

396 questions
1070
votes
14 answers

Where can I find php.ini?

A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms and what-have-you). And all was fine. Today I needed to install this which seems like a PHP library. …
necromancer
  • 23,916
  • 22
  • 68
  • 115
95
votes
4 answers

What is the difference between 'local value' and 'master value'?

When I display phpinfo(); I see two columns: local value and master value. When will the web server choose local value and when will it choose master value?
Liauchuk Ivan
  • 1,913
  • 2
  • 13
  • 22
83
votes
7 answers

How can I know which 'php.ini' file is used?

I search the path where the php.ini file is located in our Linux Ubuntu server, and I found many php.ini files when executing the command find / -name php.ini. So how can I know exactly from a PHP script web page where the php.ini is located?
pheromix
  • 18,213
  • 29
  • 88
  • 158
79
votes
17 answers

phpunit require_once() error

I recently installed phpunit on my server via the pear installer. When I go to run a test I get the following error: PHP Warning: require_once(PHPUnit/Util/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line…
user185305
  • 821
  • 1
  • 6
  • 4
72
votes
7 answers

where can I find the php.ini for php-cli

It appears that the php command line is using a different php.ini from the main php interpreter. I am using Ubuntu 10.4. My problem is that in the main php.ini I have included an extra path for an external library, but in the cli version this is not…
Elzo Valugi
  • 27,240
  • 15
  • 95
  • 114
63
votes
1 answer

php.ini reload in php-cli

I have php script that must be runned from console (php-cli). But configuration of php.ini for php-cli was incorrect. I fix it, but when I run script a had error with php config, because php.ini uses an old. How I can reload php.ini for console…
Anton
  • 633
  • 1
  • 5
  • 5
60
votes
8 answers

Increase max execution time for php

I have added set_time_limit(0); function to increase execution time but its executing only 2-3 minutes maximum. error_reporting(E_ALL); error_reporting(1); set_time_limit(0); I want to search links from a site which is taking a long time.
Bajrang
  • 8,361
  • 4
  • 27
  • 40
52
votes
9 answers

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

After upgrading Ubuntu from 14.04 to 16.04, PHP CLI started complaining about xdebug: $ php -v Cannot load Xdebug - it was already loaded PHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright…
bcmcfc
  • 25,966
  • 29
  • 109
  • 181
41
votes
3 answers

can't update php.ini file in Docker container

I'm trying to set Magento2 on Docker with Nginx & PHP7. I've added a custom php.ini file as recommended by the PHP7 Docker image. I can see from phpinfo.php that it's loading my php.ini file but none of my updates are there. It should…
Holly
  • 7,462
  • 23
  • 86
  • 140
40
votes
2 answers

Why are PHP errors printed twice?

Summary Amazingly I could find nothing about this on Google or SO. When I throw an exception in PHP it appears in my console twice, complete with error message and stack trace. The first time it's printed it says "PHP Fatal error: ..." and the…
Hubro
  • 56,214
  • 69
  • 228
  • 381
36
votes
2 answers

Set PDO to throw exceptions by default

I always want PDO to throw exceptions if an error occurs, as I always use PDO like so: try { $dbh = new PDO("mysql:host=$kdbhost;dbname=$kdbname",$kdbuser,$kdbpw); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // some…
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
28
votes
2 answers

setting max_input_vars PHP.ini directive using ini_set

Can I set the max_input_vars PHP.ini directive in my code? I have it set at the default 1000, however I have a script that has many checkboxes and text fields that could, and quite possibly will, go over the 1000 limit. I'm using PHP 5.3.10 and i'm…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
27
votes
1 answer

Remove server info and PHP info from response header

How can i prevent server info and php info to be displayed in response header
user2090305
26
votes
5 answers

PHP out of memory error even though memory_limit not reached

I have just inherited a site with a PHP script that is consistently running out of memory at 117 MB. This happens even when I increase PHP's memory_limit variable to 312 MB, which I'm doing via php.ini. This is now solved thanks to a great clue from…
user8109
  • 768
  • 1
  • 5
  • 11
24
votes
2 answers

Where are php's extensions .so files located?

I opened some some ini files like mysqli.ini , mysql.ini , pdo_mysql.ini. Inside those files there is an .so extension added for those files. I want to know where these .so files are stored. Inside mysqli.ini file ; configuration for php MySQL…
Dinesh Gowda
  • 1,044
  • 3
  • 13
  • 29
1
2 3
26 27