Jump to content


Photo

Upload file fails if over 128KB yet php.ini looks right

php upload

  • Please log in to reply
3 replies to this topic

#1 alanfluff

alanfluff

    Sr. Member

  • Members
  • PipPipPipPip
  • 439 posts
  • 128

  • LocationOttawa, Canada

Posted 02 June 2012 - 11:25 AM

I am trying to use the Admin i/f to upload a .PDF (or .DOC) and it seems I can as long as the file is 128KB or less.

I have edited php.ini for a website and now phpinfo(); reports:

post_max_size = 32M
upload_max_filesize = 24M
max_execution_time = 60
max_input_time = 60
memory_limit = 128M

I tried uploading files of gradually decreasing size and it worked for one that was 127KB but failed for one that was 132KB (and for all those larger) — the upload bar moves as expected to 100% but then does not prompt for a file description and when saving the page the file is no longer seen.

I am running PW 2.2.2.1.

Any ideas anyone pretty please?

#2 alanfluff

alanfluff

    Sr. Member

  • Members
  • PipPipPipPip
  • 439 posts
  • 128

  • LocationOttawa, Canada

Posted 02 June 2012 - 12:14 PM

The answer to this may help others, I hope.

It is not ProcessWire (I didn't think it was but I was hopeful someone else might have had some related knowledge that might have helped hence bothering you guys here). I had already spoken to the hoster in this case to work out which php.ini file was to be edited.

The answer is interesting and easy: as I was running a website with FastCGI the php.ini file just above the httpdocs location was the one to edit, not the overall one often found in /etc/php.ini. All good, I edited it. But the problem remained.

So a call to (mt), the hosters for this site, and they quickly found and fixed a one-time file that stops FastCGI working with files greater than 128KB. They upped the limit for this file to 1GB and so now this site and any others that use FastCGI will practically be controlled by the settings in their php.ini files.

Result: all is working beautifully :D

I hope this is helpful to someone else and thanks again PW people for this superb product. Cheers, -Alan

#3 Martijn Geerts

Martijn Geerts

    Sr. Member

  • Members
  • PipPipPipPip
  • 380 posts
  • 173

Posted 17 July 2012 - 02:09 PM

Wee needed FastCGI for MODX, but for ProcessWire running as apache is sufficient. Correct me when I'm wrong.

#4 alanfluff

alanfluff

    Sr. Member

  • Members
  • PipPipPipPip
  • 439 posts
  • 128

  • LocationOttawa, Canada

Posted 17 July 2012 - 02:13 PM

My understanding is you need PHP (of course) and it can be run as/via CGI but this is not good (slow and other issues I think) or PHP can be run as FastCGI module which is AOK or as an Apache module, also AOK.

So I think you are correct.

I am not an expert at PHP/Apache so apologies if I am in error here.

Edited by alan, 17 July 2012 - 02:15 PM.






Also tagged with one or more of these keywords: php, upload

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users