PHP Email Attachment Corrupt Solution -

PHP Email Attachment Corrupt Solution

I couldn't figure out why this wouldn't work, a test script in the root of my htdocs folder worked fine.

Within some subdirectories the same code would produce different base64 results but I didn't know hwy.



Archive:  /tmp/archive.zip
Zip file size: 6888 bytes, number of entries: 92
error [/tmp/archive.zip]:  missing 242827681 bytes in zipfile
  (attempting to process anyway)
error [/tmp/archive.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

Here was the problem in .htaccess!

It was because magic_quotes_gpc was being turned of by my htaccess within the subdirectory.

Now after disabling it the e-mail attachment zip is not corrupt and works fine but it was a big headache and definitely required a lot of digging/headscratching.

#php_flag magic_quotes_gpc off 
#php_flag magic_quotes_runtime on

*Update

It turns out that the real issue was just the "magic_quotes_runtime" being on.  It still works fine with the magic_quotes_gpc being turned off.


  • css responsive images
  • responsive table without changing much code solution
  • yum how to install old obsolete packages
  • PHP Howto Store Value of Included File Output Into Variable
  • PHP Migration from 5.3 to 5.4+ and dealing with deprecated functions
  • ffmpeg vidstab to stabilize video
  • userdel user userdel: cannot lock /etc/passwd; try again later.
  • mdadm how to mount inactive array
  • How to find and mount mdadm arrays automatically
  • M2Crypto.SSL.Checker.WrongHost: Peer certificate subjectAltName does not match host, expected fedora-archive.ip-connect.vn.ua, got DNS:mirror.ip-connect.vn.ua
  • [Wed Sep 20 15:34:44 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Wed Sep 20 15:34:44 2017] [error] Init: Unable to read server certificate from file /www/ssl-certs/server.crt [Wed Sep 20 15:34:44 2017] [error] SSL Library Err
  • linux how to answer yes to copy
  • linux cp and mv will not overwrite due to alias!
  • ERROR 2006 (HY000) at line 567: MySQL server has gone away
  • vbulletin 4.2.5 after upgrading from 3.6 white screen fatal php errors
  • iptables v1.4.7: can't initialize iptables table `NAT': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
  • Linux and FreeBSD how to set time and date
  • FreeBSD/OpenBSD OpenVPN Client error "Cannot allocate TUN/TAP dev dynamically"
  • kdenlive - No LADSPA plugins were found! Check your LADSPA_PATH environment variable. [producer_xml] failed to load transition "qtblend"
  • /usr/bin/supermin-helper exited with error status 1. To see full error messages you may need to enable debugging. See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs at /usr/bin/virt-list-partitions line 177.