Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > Question about php.ini file
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 24th October 21:07
jon
External User
 
Posts: 1
Default Question about php.ini file



Hi all:

I've learned, much to my pleasure, that I can place a php.ini file in the root directory of my shared domain to allow some customization of the php settings. However, when I do this, I keep getting weird results. Some of the values that I change appear as I've asked them to be. Some appear to not change at all. And some have been changing to what appears to be default values for php.

I'm wondering a few things here. First, my computer is Windows-based, but the server is Linux-based. Do I need to somehow convert the Windows text file line termination characters to their Linux variants? If so, how? Is it possible that I'm trying to change values beyond some upper limit which is causing php to use the default value?

The main values that I'm trying to change are:

post_max_size
upload_max_filesize
memory_limit
max_execution_time
max_input_time

If anyone knows of upper limits for these, I'd appreciate learning about them.

As always, any help you can send my way will be greatly appreciated!

Thanks,

Jon
  Reply With Quote


 


2 24th October 21:07
cristian.vrabie
External User
 
Posts: 1
Default Question about php.ini file



You must take in count that before php even gets to receive something,
it all passes through the HTTP server (apache or something). for most of
these settings there are equivalents in the config file of the server
that you need to change accordingly.
this might be the cause of the weird results. for example, if your limit
for uploaded files is 10M in php but the server is set to accept max 5M,
5M will be the limit
  Reply With Quote
3 24th October 21:07
jon
External User
 
Posts: 1
Default Question about php.ini file


Hi Cristian:

Thanks for the replies.

In this case, what I've been noticing is that most of the values have
gone DOWN (i.e., gotten smaller) after I placed my own php.ini file in
place. For example, upload_max_filesize was 8M before I placed my file,
but, afterwards, it was 2M! I'm trying to increase this size, not decrease
it.

Could it be the line-ending characters that are causing the problem?
Could PHP be seeing the new file but not realizing how to process it, which
would cause the values to flop over to their defaults?

Thanks,

Jon

----- Original Message -----

in the root directory of my shared domain to allow some customization of the
php settings. However, when I do this, I keep getting weird results. Some
of the values that I change appear as I've asked them to be. Some appear to
not change at all. And some have been changing to what appears to be default values for php.


Windows-based, but the server is Linux-based. Do I need to somehow convert
the Windows text file line termination characters to their Linux variants?
If so, how? Is it possible that I'm trying to change values beyond some
upper limit which is causing php to use the default value?
  Reply With Quote
4 24th October 21:07
quickshiftin
External User
 
Posts: 1
Default Question about php.ini file


do you have ssh access to the server?
i recommend you start out by creating the simplest file you can by editing
it
directly on the linux server, via vim or w/e.
then using a phpinfo() script, you should see your overridden value in the
left
column (those are for the locally overridden values).
some other things to note are;

1. apache must be properly configured to allow the .htaccess
overrides.
2. you cant override all the values in php.ini; see the documentation

regarding which ones can be overriden and where

here is an article regarding the process,
http://gentoo-wiki.com/HOWTO_php.ini...s_w/_.htaccess

-nathan
  Reply With Quote
5 24th October 21:08
jon
External User
 
Posts: 1
Default Question about php.ini file


Hi Nathan:

I'm not certain if I have all of the items you've mentioned, but I'll look into it. And thanks for the link; I'll check that out, too.

Jon

----- Original Message -----
From: Nathan Nobbe
To: Jon Westcot
Cc: PHP General
Sent: Sunday, November 04, 2007 5:05 PM
Subject: Re: [php] Question about php.ini file

Thanks for the replies.

In this case, what I've been noticing is that most of the values have
gone DOWN (i.e., gotten smaller) after I placed my own php.ini file in
place. For example, upload_max_filesize was 8M before I placed my file,
but, afterwards, it was 2M! I'm trying to increase this size, not decrease
it.

Could it be the line-ending characters that are causing the problem?
Could PHP be seeing the new file but not realizing how to process it, which
would cause the values to flop over to their defaults?

do you have ssh access to the server?
i recommend you start out by creating the simplest file you can by editing it
directly on the linux server, via vim or w/e.
then using a phpinfo() script, you should see your overridden value in the left
column (those are for the locally overridden values).
some other things to note are;

1.. apache must be properly configured to allow the .htaccess overrides.
2.. you cant override all the values in php.ini; see the documentation
regarding which ones can be overriden and where


here is an article regarding the process,
http://gentoo-wiki.com/HOWTO_php.ini_overrides_w/_.htaccess

-nathan
  Reply With Quote
6 24th October 21:08
jon
External User
 
Posts: 1
Default Question about php.ini file


Hi Nathan:

Another quick question regarding the use of the .htaccess file:

If I'm trying to set something like post_max_size, which takes a shorthand value such as 16M in place of the full value, will using the php_value type of statement also accept the shorthand value, or do I need to place in the full value?

Thanks again; this solution may be exactly what we need!

Jon

----- Original Message -----
From: Nathan Nobbe
To: Jon Westcot
Cc: PHP General
Sent: Sunday, November 04, 2007 5:05 PM
Subject: Re: [php] Question about php.ini file

Thanks for the replies.

In this case, what I've been noticing is that most of the values have
gone DOWN (i.e., gotten smaller) after I placed my own php.ini file in
place. For example, upload_max_filesize was 8M before I placed my file,
but, afterwards, it was 2M! I'm trying to increase this size, not decrease
it.

Could it be the line-ending characters that are causing the problem?
Could PHP be seeing the new file but not realizing how to process it, which
would cause the values to flop over to their defaults?

do you have ssh access to the server?
i recommend you start out by creating the simplest file you can by editing it
directly on the linux server, via vim or w/e.
then using a phpinfo() script, you should see your overridden value in the left
column (those are for the locally overridden values).
some other things to note are;

1.. apache must be properly configured to allow the .htaccess overrides.
2.. you cant override all the values in php.ini; see the documentation
regarding which ones can be overriden and where


here is an article regarding the process,
http://gentoo-wiki.com/HOWTO_php.ini_overrides_w/_.htaccess

-nathan
  Reply With Quote
7 24th October 21:08
jochem
External User
 
Posts: 1
Default Question about php.ini file


yes, valid values for ini settings are the same regardless of where you set them (.ini, apache conf, php script)
  Reply With Quote
Reply


Thread Tools
Display Modes




666