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 ...
7
votes
7answers
24k 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
3k 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?
7
votes
3answers
9k 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, ...
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
7k 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
51k 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
2k 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
5k 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
174 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
2k 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
1answer
381 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
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 ...
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
850 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
38 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
1answer
381 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 ...
2
votes
2answers
9k 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, ...
2
votes
1answer
355 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
238 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
1answer
203 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
524 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
357 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
634 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
405 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
792 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
873 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
457 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
0answers
2k views

Unable to install ffmpeg-php [closed]

I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... ...
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
5k 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
585 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
5k 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
700 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
2k 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
248 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
5answers
3k 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
3answers
313 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 ...
1
vote
1answer
3k 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
635 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
139 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
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

502 Bad gateway on big file uploads : Nginx + PHP-FPM

I'm running php-fpm on nginx I have my php.ini values set as follows upload_max_filesize = 100M post_max_size = 128M max_execution_time = 180 I have also set my client_max_body_size to 4G. When I ...
1
vote
2answers
3k 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: ...
1
vote
2answers
2k views

PLESK PostFix Error Local Loop in maillog, how to troubleshoot

I'm using the PHP mail() function, using PostFix, on CentOS6, Plesk 10.4, and my email is not getting delivered to a particular address. My personal GMail and Yahoo email addresses receive email from ...
1
vote
3answers
7k 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 = ...
1
vote
2answers
2k 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 ...
1
vote
1answer
529 views

PHP's SMTP configuration on ubuntu?

http://ca3.php.net/manual/en/mail.configuration.php#ini.smtp Looking at the manual, it specifies that the php.ini option for selecting an SMTP server is a windows-only thing. What do I do to ...
1
vote
2answers
1k views

PHP in snow leopard

Snow leopard comes with PHP already installed and configured I am running a web application on a development server which has MAMP and the system runs fine however when I put the application on a ...
1
vote
2answers
380 views

is there any way to find out how I was hacked? What was the weak point?

one of my site hacked few times :( first I lost all databases, some tables were cleared and some of table's data had changed! than at the second hack, all tables were cleared and some php files' codes ...