php.ini is the configuration file used by the PHP preprocessor to setup the default settings and certain security restrictions.

learn more… | top users | synonyms

10
votes
2answers
7k views

Separate php.ini file for each Apache virtual host?

Is it possible to have a separate php.ini file that overrides the default php.ini file for each virtual host? I'm running Apache/2.2.14, PHP 5.3.2-1. For example, I have several vhosts pointing to ...
8
votes
3answers
9k views

Increase PHP-FPM's max upload/post size

I'm running php5-fpm under Nginx on Ubuntu 14.04. I want to increase the max upload size. I have edited my /etc/php5/fpm/php.ini to have the following lines defined as below: upload_max_filesize = ...
8
votes
3answers
14k views

Allow using php_value and php_flag in .htaccess

I am running an Apache web server with PHP5 as a module (notice: as an Apache module, not CGI!). In some of my .htaccess files (the one that comes with the gallery3 software, ...
7
votes
7answers
28k views

How to configure php.ini with remote SMTP?

How do I configure PHP to send mail using mail() via a remote SMTP server? I've tried to do this using php.ini but it seems that you can only do that under Windows32 and I want to do this on my Unix ...
7
votes
1answer
5k views

Apache restart needed for PHP to re-read php.ini?

Does PHP read php.ini on each request or do I have to restart Apache for php to be aware of changes on php.ini?
6
votes
3answers
15k views

php writing deprecated errors to apache error log

I just upgraded from Debian Lenny to Squeeze and noticed that my /var/log/apache2/errors.log is getting bombarded with the following errors: <b>Warning</b>: Directive 'magic_quotes_gpc' ...
5
votes
2answers
9k views

Php.ini disable “Scan this dir for additional .ini files”?

I want to lock my php configuration and disable loading other php configurations rather than the default (which in my case is located at /usr/local/php/lib/php.ini) I want to disable the "Scan this ...
5
votes
5answers
61k views

How do I enable SQLite on Linux/Apache/PHP?

To enable SQLite on my Windows/Apache/PHP setup, I uncomment the following lines in the php.ini file and restart Apache: extension=php_pdo.dll extension=php_pdo_sqlite.dll Now I have a VPS with ...
5
votes
1answer
3k views

How To Change What Version of PHP Apache2 Uses?

Ubuntu 10.04, MySQL 5.1, Apache 2.2, and PHP 5.2/5.3: I just discovered that I am using the wrong version of PHP for a CRM application. Once I figured out how to make a simple phpinfo() script to ...
5
votes
4answers
7k views

PHP date.timezone warning

I keep getting this error: Message: date() [function.date]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the ...
4
votes
4answers
7k views

The requested PHP extension ext-mcrypt * is missing from your system [closed]

I have updated my php to version 5.4.13 etc and well in the terminal my version of php states this PHP 5.4.12 (cli) (built: Mar 16 2013 21:46:23) But running a composer install io get the ...
4
votes
3answers
219 views

Can't get PHP to stop showing errors

Contrary to most people's problem I cannot get PHP to stop showing errors, I have in my php.ini display_errors set to off but it still shows them, I have also tried .htaccess, and inline ini_set and ...
4
votes
4answers
3k views

Do I have to recompile php to enable GD Library?

I have a GD library on my server installed and 'enabled' but under the Configure Command in php.info it says "--without-gd" Is there a way to enable it through root or do I have to recompile? ...
3
votes
2answers
15k views

Disabling PHP Deprecation Warnings and Notices

I've been using and configuring PHP, but now I'm stuck in a weird problem, so I am going to ask you guys for help. I don't want to see Deprecation Warnings and Notices in a production server, ...
3
votes
1answer
484 views

How to disallow use of disable_functions in?

I'm obviously not the first one to have this problem, but I cannot not find an answer to this situation. I want to lock down PHP a bit, more specifically the use of disable_functions. The environment ...
3
votes
3answers
1k views

How do I upload large (30MB) files via a web interface?

Because I'm stumped... The client needs to be able to upload large images to a library but the upload fails after 5-6MB (over my poor connection). It seems to be timing out as the filesize at fail ...
3
votes
1answer
3k views

APCu and APC setting unclear

Please help me to understand where is difference between APC and APCu lies. While inspecting CentOS web-server (set up not by me) found that it has APCu 4.0.2 installed and phpinfo(); reports that APC ...
3
votes
2answers
956 views

How can I override global PHP.INI settings on shared hosting?

I have sharring hosting account on Linux Apache PHP with JustHost. In my account exists a global php.ini that only admin of hosting company can access. My problem is that when I run php script the ...
3
votes
1answer
333 views

Restrict Overriding memory_limit in php.ini

We have a issue that just came to our notice, some of our developers used ini_set('memory_limit', -1) to over-ride the php.ini memory_limit settings in their code files. Due to which sometimes our ...
3
votes
3answers
12k views

Hide STRICT errors on PHP 5.4

I've upgraded from PHP 5.3 to PHP 5.4 today. Now my script is displaying a lot of error messages. How to hide them without using error_reporting(0); inside php file ? I use this: error_reporting = ...
3
votes
1answer
421 views

PHP DL Function

Is allowing dynamic extension loading dangerous for some reason? I ask because I need it to include the pecl oauth.so extension to make the Google Adwords PHP SDK work using dl(). I've tried all ...
3
votes
1answer
292 views

Enforce loading of php.ini files from current folder

My goal is to increase the maximum file size for uploads in WordPress. I have followed the steps on this SE answer and this tutorial (except the .htaccess part, because it's runnning nginx and AFAIK ...
2
votes
3answers
1k views

PHP cli uses different php.ini file when run by cron

My CakePHP console script is having problems executing under cron. It complains about missing Mysql connections and such. After a little investigating I found that php run by cron uses a different ...
2
votes
1answer
725 views

Is there an equivalent to Debian's cli/php.ini on Redhat?

How do you configure the command line version of PHP to have different settings on a Redhat system? On Debian based systems, php has a separate command-line version config file: /etc/php5/cli. On ...
2
votes
1answer
504 views

How do I prevent Apache/PHP from showing the environment variables section in phpinfo()?

I need to prevent users from accidentally exposing private data stored in the environment variables with phpinfo(). Is there a way to configure apache or php.ini to disallow sections rendered with ...
2
votes
2answers
5k views

PHP - Extensions - no-debug-non-zts-xxxxxxxx

I am compiling php extensions (memcached and xdebug), and when I run make install, they keep getting installed into /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626. So a few questions: ...
2
votes
1answer
268 views

Updated php.ini but php.info shows different values

I've updated php.ini using root with some value changes in max time out and upload file size and such, but when I checked mywebsite.com/info.php I don't see the changes on what I've edited. What ...
2
votes
2answers
130 views

Is there a way to allow `<?php` and `<?=` open tag but not `<?`?

In PHP I would like to be able to use the <?= open tag (which is similar in effect to <?php echo) but I would also like to disallow the use of the short open tag for any other use than quickly ...
2
votes
2answers
533 views

How do I get Apache to use a different local PHP.ini for different domains?

is there some sort of .htaccess directive. I dont have access to httpd.conf. I have php5 in a fastcgi/cgi module. Multiple domains. But for some reason all the domains are pointing to the first ...
2
votes
1answer
477 views

Suhosin per-URL exceptions?

I am using SimpleID as my OpenID provider and it turns out that if I log on via pages like those on StackExchange, one of the parameters of the GET request gets dropped by Suhosin. The name of the ...
2
votes
3answers
825 views

Configuring php.ini to prevent attacks

I have been attacked on a shared host server (heartinternet) and they said I should configure my own php.ini file properly. Well I have a little php/MySQL program with a registering function, a ...
2
votes
2answers
3k views

Changes made to cli's php.ini not taking effect

I have two php.ini files - /etc/php.ini which loads in case of cli /opt/lampp/etc/php.ini which loads in case of browser. I am able to use PHP's Mailparse extension after adding the line ...
2
votes
1answer
577 views

Store session files in different directories in PHP

I have several sites hosted on the same server, in different directories (e.g: server.com/site_one, server.com/site_two) and I want to store the session files for each site in a different directory. ...
2
votes
1answer
982 views

Using separate php.ini files per vhost in Xampp

My web host provides separate php.ini files per web root, which is quite useful as I host some websites which require different PHP settings. But on my dev system where I use Xampp, I can only find a ...
2
votes
1answer
5k views

php-fpm Bad file descriptor errors

I'm using php-fpm with customer separate pools. Sometimes page are freezing, then showing 500 internal server error, and I'm getting such errors in error log: [11-Feb-2013 22:12:39] ERROR: unable to ...
2
votes
1answer
2k views

Do we need to explicitly pass php.ini's location to php-fpm?

I am seeing a strange issue where my php.ini is not used if I do not explicitly pass it to php-fpm when starting it. This is the upstart script I am using: start on (filesystem and net-device-up ...
2
votes
2answers
2k views

Settings on php.ini ignored

I can't get my server to obey the settings from php.ini (I'm trying to change memory_limit and upload_max_filesize). As far as I can tell, I'm editing the correct file. phpinfo() gives: Loaded ...
2
votes
1answer
1k views

PHP CLI: Call to undefined function mysql_connect() even with mysql module enabled

I try to run a PHP script from the command line, but get the following error: Call to undefined function mysql_connect() However, the mysql module is loaded: root /var/www/scripts # php -m | grep ...
2
votes
3answers
3k views

php.ini not loading on Windows7 x64

I have manually configured PHP in the past without any problems. Now I'm trying to set up a dev environment with PHP 5.3.1 on Windows 7 x64, and it won't load the php.ini file! I'm new to both ...
2
votes
2answers
6k views

How do I configure multiple PHP.INI files on shared host running Apache?

I would like to use a different PHP.INI file for each site hosted on a shared server. I have modified the Apache vhosts file for each of the sites, adding the line… PHPINIDir /srv/www/my-domain.com/ ...
1
vote
3answers
995 views

How to get path of php.ini?

I have currently 3 php.iniS files in my /etc/php5 path. tree: ./php5_ ./php5_/cli ./php5_/cli/conf.d ./php5_/cli/php.ini ./php5_/apache2 ./php5_/apache2/conf.d ./php5_/apache2/php.ini ./php5_/conf.d ...
1
vote
2answers
11k views

register_globals error in php

I was stuck up with the error directive 'register_globals' is no longer available in PHP in unknown on line 0 when tried to check the php version using "php -v" after enabling register_globals in ...
1
vote
2answers
5k views

Failed to write session data

I have a VPS running on CentOS 5 with Plesk 9. My website us running on FastCGI. I'm having problems reading / writing sessions. On my servers error_log I get the following errors: (...) Failed to ...
1
vote
3answers
1k views

Setting memory_limit in php.ini - can I use all of the available system memory?

Sorry in advance for the newbie question, but I have a dedicated virtual server I'm working on that has 512MB of RAM memory. I've recently changed the memory_limit from the default of 128M to 256M. Is ...
1
vote
4answers
3k views

Unable to upload files larger than 128KB error because of ​MaxRequestLen update

server : Plesk panel 10.3.1, PHP 5, Apache2 When I updated the plesk panel, I noticed a strange error while uploading files. My server does not allow any file to be uploaded above the 128kb, even ...
1
vote
2answers
273 views

max_execution_time (PHP) <- when does it start to count?

I have few very-long-executing scripts, and my max_execution_time is 5 However, when I was taking some information from plus.google.com, it took about five minutes. It all worked well but it was just ...
1
vote
2answers
3k views

PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/apc.so'

I have updated my php from 5.3.3 to 5.4.31. I have a Debian 6 Squeeze. PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/apc.so' - /usr/lib/php5/20100525/apc.so: ...
1
vote
3answers
3k views

PHP Errors are not stored on CentOS Server

I just adjusted the php.ini on my CentOS 64 Bits VPS in /etc/php.ini to log PHP errors: cat /etc/php.ini | grep php-errors.log error_log = /var/log/php-errors.log I also have log_errors = on I ...
1
vote
1answer
5k views

Can we have 2 'extension_dir' in php.ini?

When I installed pdo-pgsql, the extension was installed into /usr/lib/php/extensions/no-debug-non-zts-20090626/ and thus not automatically loaded. In php.ini, I have extension_dir = ...
1
vote
5answers
6k views

PHP short_open_tag Won't Enable (CentOS 6)

I'm setting up an Apache2, PHP 5.3.3 server running on CentOS 6. My web application uses the short tags <? and <?=. I can't seem to get the short tags enabled. When I run phpinfo() I see ...