?
Solved

Custom php.ini or equiv.

Posted on 2003-02-28
19
Medium Priority
?
597 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 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