ini_set() question....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

ini_set() question....

Post by neophyte »

I"m writing a file upload script. My script requires a larger max_file_size be set in the php ini. So I'm using ini_set to change the size allowable. But my script keeps dieing. It would seem that it is not executing. Here's what I'm using.

Code: Select all

<?php
if ( ini_set("upload_max_filesize ", $max_file_size ) )
{
//Do stuff to the file

}
else
{
die("php ini not set");

}

?>
I keep geting php ini not set. Could this be because the script timed out?
Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Quote from php.net
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.
Unless you have register globals on your script will never be TRUE, therefor, will aways DIE.
Post Reply