Forgive my ignorance but do you mean I should create a php.ini file with that code and upload it to the webspace?
Should it go in the httpdocs (root) of the site?
Should I remove the .htaccess file?
Main Topics
Browse All TopicsDear all,
I have a script written for me by a member here some while ago.
I am using it on a new website and when I try to upload a large photo it is failing and comes back blank - it does not say the upload failed, simply it comes back blank (the header and footer of the website comes back but anything within the PHP does not.
For small photos it works well and uploads it to the folder.
I have tried increasing the following using a .htaccess file:
memory_limit to 100MB
post_max_size to 100MB
upload_max_filesize to 100Mb
still it did not work. the defaults are now set again and they are:
memory_limit to 24MB
post_max_size to 8MB
upload_max_filesize to 10Mb.
The code is pasted below and the php settings are here:
http://arockes.org.uk/imag
The uploader web page is here: http://arockes.org.uk/phot
PHP is something that does not make a huge amount of sense to me so if you could shed any light on this I would really appreciate it.
Kind regards,
Jack
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can simply change the setting right from your php file,
let say you have a file called. pictures.php
<?php
ini_set("upload_max_filesi
//then you do the uploading stuff, as I think the upload happens in only one file ... right?
?>
Please let me know if this is unclear.
You must have other stuff in your .htaccess, but comment the line where it changes the settings.
The .htaccess only has the following:
memory_limit to 24MB
post_max_size to 8MB
upload_max_filesize to 10Mb
so I will remove it.
I am a little unclear with your instructions. The entire page is below in the code snippet, I added the line you said at the beginning of the php.
Yes you are correct, it all happens in the one file.
Jack
Hi Seo,
I did conntact them initially and they told me to create use an .htaccess file. If I make changes to this file it is immediately reflected in this: http://arockes.org.uk/imag
Appreciate the help guys, php makes css (which I have just begun with) look easy!
I have done that.
I created a separate test file for this:
http://www.arockes.org.uk/
Its was not working for anything ..even tiny files, then I removed the following and it worked again for tiny files.
<?php
ini_set("upload_max_filesi
ini_set("memory_limit","10
ini_set("post_max_size","1
?>
http://www.arockes.org.uk/
The PHP info page now does NOT work for some reason.
This is strange. I changed the MB to Ms in the .htaccess - this fixed php_info. Good!
Then the upload was still not working so I put this back in:
<?php
ini_set("upload_max_filesi
ini_set("memory_limit","10
ini_set("post_max_size","1
?>
This did not work, so I made the 100s in to "100M"s. I can now upload a 0.6MB photo. A 2.2MB still does not work and gives the blank page after a minute or so (slow upload).
Right, to try and solve this and thinking about it I do not really need the image resize and resample. Do you think it would work if we got rid of that aspect and simply made it a straight forward file uploader?
Many thanks again,
Jack
There are restrictions on where each setting can be set.
http://ca2.php.net/manual/
Not getting anywhere with this unfortunately. Have tried uping the limits, also I read this in your link and made the changes:
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 .
Still it didn't work. What do you think about removing the resize code and having it just as a straight forward upload?
Is it the resize of the images that is causing this?
Jack
Are you using this script: http://www.arockes.org.uk/
I don't know about that, because I don't have a digital camera and haven't tried it, but I guess the only way to fail, is for the uploaded not to be able to read the file.
I guess the only way to be sure, is have a note on the site and tell them to move the image in the computer.
Have you tried uploading the 3mb from the digital camera?
Yes, I have this script which is on a different host which has no problems with 5MB files.
www.cloverleaf4.co.uk/uplo
I think I need to get on to the host and see if they can help.
If you can, download this file and try it on the upload:
http://upload.wikimedia.or
Sure, it is currently downloading, I'll let you know the result, I will upload using http://www.arockes.org.uk/
No watermarking on the photos. I think I need to give up with this for now. Just can not work it out. I added error_reporting(E_ALL) but it didnt give anything away at all when giving the blank page.
<?php
error_reporting(E_ALL);
?>
<?
if($_SERVER['REQUEST_METHO
?>
Is it ok inserted like this?
I'm sorry to hear that your host didn't do anything, I have PHP 5.2.10 installed on Apache 2 on Windows XP Sp2. The following is the content of the htaccess:
RewriteEngine on
php_value upload_max_filesize 100M
php_value memory_limit 100M
php_value post_max_size 100M
Using the original script in your question, allows me to upload any size pictures even the
http://upload.wikimedia.or
Could you please copy the original script into a file, just call it test.php and run it, and see if that works, and make sure to have .htaccess with the above content in it.
Let me know how it went,
Hi, I will close this question. The script that was written for me some time ago that I referred to in the first line of my question worked unedited so there must be something vital that I removed.
Points awarded to Jagarm, very grateful for the effort you went to to try and help me solve this.
Thanks
Jack
Business Accounts
Answer for Membership
by: JagarmPosted on 2009-07-03 at 05:54:47ID: 24772010
Set those settings through PHP right before you do the upload stuff:
ze","100") ;
ini_set("upload_max_filesi
do the same thing with the other ones
Let me know how it goes