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
11k 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
25k 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
4k 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
14k 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
8k 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
55k 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
6k 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
3answers
194 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
12k 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
425 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
2answers
918 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
121 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
10k 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
394 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
188 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
843 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
610 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
2answers
3k 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 = ...
2
votes
1answer
376 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
4k 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
224 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
129 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
529 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
417 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
728 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
1answer
468 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
900 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
1k 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
1answer
1k 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
760 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
699 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
8k 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
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
258 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
1answer
4k 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
2answers
1k 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
4answers
4k 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 ...
1
vote
2answers
716 views

Able to configure/compile PHP --with-ldap, but LDAP is not listed in phpinfo()

I am trying to compile PHP with LDAP support using these lines: ./configure --prefix=/app/php --with-ldap=/usr sudo make sudo make install Everything appears to install fine without ...
1
vote
1answer
150 views

PHP upgrading to 5.3.3 - what should I be aware of?

I have a VPS that's hosting half a dozen PHP-based sites. All is OK on php5.2.10 but I want to upgrade to 5.3.3. I have tested the functionality of the sites on my local dev machine running 5.3.1 and ...
1
vote
2answers
2k views

Cannot get PHP PAM authentication to work

This question is split between the realm of SO and SF. It's for a coding project but I believe the error I'm encountering has more to do with system administration than code, so I'll put it here. ...
1
vote
5answers
1k views

User Specific Php.ini When php is ran as a module?

I have a php setting that can only be changed in the ini file. I can't change this setting in the global php.ini due to conflicts, so I'll need to have this user specific. Can this be done if php is ...
1
vote
1answer
1k views

Can't configure PHP error log

I'm running apache2 with php5 on Linux Mint 13 Maya. I have defined a virtual host and these two entries there: ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ...
1
vote
2answers
2k views

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

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 ...