?
Solved

Custom php.ini or equiv.

Posted on 2003-02-28
19
Medium Priority
?
614 Views
Last Modified: 2012-08-14
I registered a domain and am setup with a hosting company, one thing I am trying to do is upload a file greater then 2M, I was able to modify a .htaccess file to modify the upload_max_filesize to 1024M, and that worked, but the post_max_size would not set the value.

.htaccess
#-----------------------------------
php_value post_max_size 1024M
php_value upload_max_filesize 1024M
#-----------------------------------

Because upload_max_filesize stays at the default of 8M It will not modify this value.

ini_set() does not work.  So the last solution I can think of is too upload a custom php.ini file.

If anyone know how to set this up.  please help.
0
Comment
Question by:lfabbric
  • 9
  • 6
  • 2
  • +2
19 Comments
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8046821
there is nothing much problem just know where is your php.ini file download it modify it and upload it and restart your server.

Harry
0
 
LVL 1

Author Comment

by:lfabbric
ID: 8046863
I do not have access to do this.  Someone is hosting my site, otherwise I would.
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8046920
Have you tried this

echo ini_set("upload_max_filesize","100MB");

Sets the value of the given configuration option. Returns the old value on success, FALSE on failure. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.

Harry
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:lfabbric
ID: 8046935
Actually yes.  

I used:
if(ini_set("upload_max_filesize", "4M")
  echo "Worked";
else
  echo "Failed";


0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8046950
Try this it worked with me

<?
if(ini_set("upload_max_filesize", "4M")){
 echo "Worked";
}
else{
 echo "Failed";
}
?>

Harry
0
 
LVL 1

Author Comment

by:lfabbric
ID: 8046980
Im sorry,

If you do the exact same thing

<?
if(ini_set("post_max_size", "4M")){
echo "Worked";
}
else{
echo "Failed";
}
?>

This will fail everytime.

The upload_max_filesize works fine for me as well.

(I am actually having problems with post_max_size, not upload_max_filesize)

I can set upload_max_filesize to any value I want, through set_ini or .htaccess.  But not the post_max_size.

neither ini_set or .htaccess will set those values.
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8047007
Oh that is the case

see post_max_size,sendmail_path,user_dir,user_dir these are the example of SYSTEM ini attribute and Entry can be set in php.ini or httpd.conf not else where


Harry
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8047021
Or take a look at this url

http://www.php.net/ini_set

Harry
0
 
LVL 8

Expert Comment

by:us111
ID: 8047256
from the doc:
post_max_size integer
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.

If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.

check memory_limit
0
 
LVL 6

Expert Comment

by:carchitect
ID: 8047504
look for few things

http://www.php.net/manual/en/configuration.directives.php#ini.memory-limit

try to work on memory limit...
regards
0
 
LVL 1

Author Comment

by:lfabbric
ID: 8048169
It doesn't complain when I modify the memory_limit (Yet it also doesn't show with phpinfo())

I do not believe memory limit is enabled.

Could someone test to see if this works with a version of apache and php.

create a .htaccess file within your webroot.

.htaccess
 php_value upload_tmp_dir          /var/tmp
 php_value post_max_size           1024M
 php_value file_uploads               On
 php_value upload_max_filesize      1024M
 php_value memory_limit               20M

And set all same values within your php.ini to a different value.

And then restart apache, I just want to see if restarting apache fixes this problem.
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8050862
Do you have access to httpd.conf of php.ini as the post_max_file can be set in anyof two I also mentioned before.

Harry
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8050870
Please read the link they mentioned it that you can change in php.ini and httpd.conf file only. Sorry for my previos comment its post_max_size

http://www.php.net/ini_set

Harry
0
 
LVL 1

Author Comment

by:lfabbric
ID: 8050905
My site is being hosted by someone else, and they refused to set that one parameter, so I am stuck trying to set this parameter.
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8050960
So if they are not allowing you to use this parameter why not use ftp instead of biguploads. If you want it

Harry
0
 
LVL 1

Author Comment

by:lfabbric
ID: 8052317
Becuase I want them to be able to upload through a web forum.  I have to put the file within a database as well other information.
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8055305
I think then there is no solution what I suggest you that ask you host to increase the upload file size. Or do one thing what every you take information from the use which he is going to key in take the value and put into database and take the upload file and use ftp function to upload to the perticulat directory.

Harry
0
 

Expert Comment

by:SpideyMod
ID: 8132865
A request for a refund has been made.  Experts, you have 72 hours to object or I intend to grant the request.

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8154045
PAQ'd and all 250 points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question