How do I modify my phpinfo attributes?
I need to change the following attribute values that show up in phpinfo():
How do I do this? I need to increase these numbers.
post_max_size - 8MB
memory_limit - 40M
max_execution_time - 50000
You need to modify your php.ini or call ini_set() in your script. http://php.net/manual/en/function.ini-set.php
Ok, I'm trying this. It doesn't seem to be working. here's what I'm doing:
The phpinfo() still reports the old values, and it is still not working. Am I missing something?
Some PHP configurations disable this function on some or all particular settings. You may need to alter the php.ini manually.
There are 4 types of directives
Here's the list of all of them
PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or in the Windows registry
PHP_INI_PERDIR Entry can be set in php.ini, .htaccess or httpd.conf
PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf
PHP_INI_ALL Entry can be set anywhere
Click through the links on each one and read the notes. There's more to this then you might realize. post_max_size 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. Don't host your hosts resources.
The 3 you're interested in are
So as you have a PHP_INI_PERDIR in there, it would make sense to set all 3 in a .htaccess for an upload directory and keep them together. I'm on IIS so am a bit rusty on .htaccess but something like this should do the trick (with whatever values you need).
post_max_size - PHP_INI_PERDIR
memory_limit - PHP_INI_ALL
max_execution_time - PHP_INI_ALL
Save it as a file called .htaccess. Next make sure your FTP client has the ability to see hidden files and check there is not already an .htaccess file in the directory you're FTPing to, some hosts use them. If there is dl it and add those lines to it, or just FTP it to the upload directory where your upload scripts are.
php_flag post_max_size 1100M
php_flag upload_max_filesize 1000M
php_flag memory_limit 1200M
php_flag max_execution_time 300
If you're uploading big files look into the progress bar scripts. There are a few prewritten that should be easy enough to make fit your needs.
Ok, I'm taking a slightly different approach. I made a php.ini file for the directory. This should fix it. I added these variables, and I'm trying to upload a 12MB file.
After uploading (or attempting to upload), my script gives an error. Specifically, the $_FILES["file"]["error"] generates 2, meaning the file I'm uploading is larger than the allowed file size. Are there other variables I have to set?
upload_max_filesize = 10000M
post_max_size = 10000M
memory_limit = 120000M
max_execution_time = 3000
set_time_limit = 500000000
Stop cross posting! Pick a thread!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread