SOLVED Avantfax send size limit

jeffmac

Guru
Joined
Jan 16, 2008
Messages
230
Reaction score
9
Alright, fellas, I have reached my maximum depth on this problem.

I have a new PIAF 2.0.6.2.1 (I'll include status below) and I've installed incredible PBX 3 and incredible fax 2. I have been successful receiving faxes (after some permission tweaks you can find in other forum threads) and I can send faxes as well - as long as the total file size I'm sending is less than 8 MB. But trying to send 2 tiff files is just slightly too big.

I found the following message in /var/log/httpd/error_log:

PHP Warning: POST Content-Length of 8817069 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer: http://{mylocalip}/avantfax/sendfax.php

I have no experience in PHP, but I can find in sendfax.php a reference to uploading my files, but I can't really decode it.

I've found other similar questions via Google, but the only ones with answers point to "upload_max_filesize" in php.ini. The php.ini file (provided via PIAF, I presume) has this variable set to 100M.

I found some PHP docs that claims this variable can be set in php.ini, .htaccess, or httpd.conf. I've already stated that its set to 100M in the php.ini, and I don't see it anywhere else.

Can one of you more proficient in PHP give me a hand?

Jeff
 

Attachments

  • status-output.txt
    7.7 KB · Views: 3

The Deacon

Guru
Joined
Jan 29, 2008
Messages
296
Reaction score
14
This fatal PHP error crops up because, by default, PHP has a memory usage limit of 8 MB for any given script. Most folks (myself included) view this as a "Good Thing"; but sometimes, you have a script that needs to exceed the 8 MB limit. The workaround for the "Fatal error" is easy, just insert this line after line 13 in sendfax.php:

ini_set("memory_limit","32M");

That should do the trick.

-Rick
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
So should this be set as a default in new installs?

Tom
 

jeffmac

Guru
Joined
Jan 16, 2008
Messages
230
Reaction score
9
Thanks for the pointer, Rick - but it made no difference.

Since this is PHP invoked from a web page I saw no reason to bounce FreePBX or Asterisk. And I'm guessing it doesn't really require a cycle of the http server (although I did).

No change before or after restart of httpd. The same message is in the error_log in both cases.

Jeff
 

The Deacon

Guru
Joined
Jan 29, 2008
Messages
296
Reaction score
14
Hrrmmmmm. That's weird; should have worked.

Back to the drawing board...

-Rick
 

trupsalms

Member
Joined
May 13, 2011
Messages
337
Reaction score
6
For me The Issue Of The File Does Not Send To Be the Problem As Far as Sending, But The Converting Of The File To Send
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
70
I haven't checked but could it simply be that the php installation is hardened to ignore the ini settings modifications at runtime.

If I'm installating php on a shared server I do not want people to control the settings I made system wide from their scripts.

If this is the case here that settings your trying to override is ignored because of another config preventing that.

Make sense?
 

jeffmac

Guru
Joined
Jan 16, 2008
Messages
230
Reaction score
9
I FOUND IT!! I FOUND IT!!

I kept digging around in the PHP documentation and I kept coming back to the maximum post size. It was right in front of my face every time I looked in php.ini but I didn't SEE it until I ran a little piece of test code that displays the maximum upload size.

The php.ini parameter for maximum post size is:
post_max_size

The /etc/php.ini file (distributed by PIAF or updated by one of the "incredible" scripts) has the following:
post_max_filesize = 100M

result: default post_max_size = 8M

I changed /etc/php.ini to post_max_size = 100M and my fax files which total appox 8.5 MB was successfully sent!

Tom, I think this needs to be checked !

Jeff
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
isnt that interesting.

Will try to track down the code and see how it gets to be set this way.


Tom
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Good catch!

It is not actually in the incredible installs it is much earlier. Some leftover code. When I look back through svn it looks like it was introduced about 6 months ago.

Just doing a recompile and pushing out update-fixes should be available tomorrow.


Tom
 

Marc Lange

New Member
Joined
Sep 13, 2015
Messages
21
Reaction score
4
Hello,

In Incredible PBX/FAX 13-12.3 for CentOS 6 (Asterisk 13.18.3), the buggy code remains present but is easily fixed.

The /etc/php.ini file must be edited.

Type:
nano /etc/php.ini

Find the line as indicated in above thread that reads:
post_max_size = 8M

change it to:
post_max_size = 20M

save, then:
/etc/rc.d/init.d/httpd restart

problem solved. Thank you @jeffmac for solution still useful 8 years later.

Changing it to 20M will therefore match the AvantFax GUI message, and will also match the line further in the ini file which says:
upload_max_filesize = 20M

Marc
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,170
Reaction score
5,199
This was an Oldie but Goodie that fell through the cracks with the migration from PIAF3 to Incredible PBX.

incrediblefax13.sh and incrediblefax11.sh installers have been updated. Thanks, @Marc Lange. Also updated bug list: http://nerd.bz/BugCheck

Here's the fix for existing systems:

Code:
sed -i 's|post_max_size = 8M|post_max_size = 20M|' /etc/php.ini
/etc/init.d/httpd restart
 
Last edited:

Members online

Forum statistics

Threads
25,782
Messages
167,514
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top