PHP+Roundcube+IIS7 - No good error msg - Failure uploading attachment > 1.6MB

Scenario: Running Roundcube + IIS 7 + Php 5.4.4 + Hmailserver on a Win7 ultimate machine.

I’ve spent countless hours searching, and I still can’t figure out if this is a PHP problem, IIS, or Roundcube problem… especially since I can’t find a decent error msg in any log file.

Problem: I can’t seem to attach a file in roundcube larger than 1.6MB. The only message I get is File Upload Failed. I have looked in the IIS logs, the roundcube logs, and the php logs to no avail! Is there another way I can get a verbose diagnostic error here? (I only included HMailserver to give a full outlook, but it is not involved in the equation as roundcube is configured to use an external server for smtp).

PHP.INI settings: post_max_size = 200M; upload_max_filesize = 20M; Max_file_uploads = 20 memory_limit = 256M;

I wanted to include a link to a pdf of my phpinfo, but it won’t let me. So here’s the ful text… oy…

(thanks)

[hr]

[code]PHP Version 5.4.4

System -----Windows NT 6.1 build 7601 (Windows 7 Ultimate Edition Service Pack 1) i586
Build Date -----Jun 13 2012 21:17:57
Compiler -----MSVC9 (Visual C++ 2008)
Architecture -----x86
Configure Command -----cscript /nologo configure.js “–enable-snapshot-build” “–disable-isapi” “–enable-debug-pack” “–without-mssql” “–without-pdo-mssql” “–without-pi3web” “–with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared” “–with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared” “–with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared” “–enable-object-out-dir=…/obj/” “–enable-com-dotnet” “–with-mcrypt=static” “–disable-static-analyze” “–with-pgo”
Server API -----CGI/FastCGI
Virtual Directory Support -----enabled
Configuration File (php.ini) Path -----C:\windows
Loaded Configuration File -----C:\Program Files (x86)\PHP\v5.4.4\php.ini
Scan this dir for additional .ini files -----(none)
Additional .ini files parsed -----(none)
PHP API -----20100412
PHP Extension -----20100525
Zend Extension -----220100525
Zend Extension Build -----API220100525,TS,VC9
PHP Extension Build -----API20100525,TS,VC9
Debug Build -----no
Thread Safety -----enabled
Zend Signal Handling -----disabled
Zend Memory Manager -----enabled
Zend Multibyte Support -----provided by mbstring
IPv6 Support -----enabled
DTrace Support -----disabled
Registered PHP Streams-----php, file, glob, data, http, ftp, zip, compress.zlib, https, ftps, phar, sqlsrv
Registered Stream Socket Transports-----tcp, udp, ssl, sslv3, sslv2, tls
Registered Stream Filters-----convert.iconv., mcrypt., mdecrypt., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, zlib.*

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright © 1998-2012 Zend Technologies

PHP Credits
Configuration
bcmath
BCMath support -----enabled

Directive-----Local Value-----Master Value
bcmath.scale-----0-----0

calendar
Calendar support -----enabled

cgi-fcgi
Directive-----Local Value-----Master Value
cgi.check_shebang_line-----1-----1
cgi.discard_path-----0-----0
cgi.fix_pathinfo-----1-----1
cgi.force_redirect-----0-----0
cgi.nph-----0-----0
cgi.redirect_status_env-----no value-----no value
cgi.rfc2616_headers-----0-----0
fastcgi.impersonate-----1-----1
fastcgi.logging-----1-----1

com_dotnet
COM support-----enabled
DCOM support-----disabled
.Net support-----enabled

Directive-----Local Value-----Master Value
com.allow_dcom-----0-----0
com.autoregister_casesensitive-----1-----1
com.autoregister_typelib-----0-----0
com.autoregister_verbose-----0-----0
com.code_page-----no value-----no value
com.typelib_file-----no value-----no value

Core
PHP Version -----5.4.4

Directive-----Local Value-----Master Value
allow_url_fopen-----On-----On
allow_url_include-----Off-----Off
always_populate_raw_post_data-----Off-----Off
arg_separator.input-----&-----&
arg_separator.output-----&-----&
asp_tags-----Off-----Off
auto_append_file-----no value-----no value
auto_globals_jit-----On-----On
auto_prepend_file-----no value-----no value
browscap-----no value-----no value
default_charset-----no value-----no value
default_mimetype-----text/html-----text/html
disable_classes-----no value-----no value
disable_functions-----no value-----no value
display_errors-----On-----On
display_startup_errors-----Off-----Off
doc_root-----no value-----no value
docref_ext-----no value-----no value
docref_root-----no value-----no value
enable_dl-----Off-----Off
enable_post_data_reading-----On-----On
error_append_string-----no value-----no value
error_log-----C:\windows\Temp\php-5.4.4_errors.log-----C:\windows\Temp\php-5.4.4_errors.log
error_prepend_string-----no value-----no value
error_reporting-----32767-----32767
exit_on_timeout-----Off-----Off
expose_php-----On-----On
extension_dir-----C:\Program Files (x86)\PHP\v5.4.4\ext-----C:\Program Files (x86)\PHP\v5.4.4\ext
file_uploads-----On-----On
highlight.comment-----#FF8000-----#FF8000
highlight.default-----#0000BB-----#0000BB
highlight.html-----#000000-----#000000
highlight.keyword-----#007700-----#007700
highlight.string-----#DD0000-----#DD0000
html_errors-----On-----On
ignore_repeated_errors-----Off-----Off
ignore_repeated_source-----Off-----Off
ignore_user_abort-----Off-----Off
implicit_flush-----Off-----Off
include_path-----.;C:\php\pear-----.;C:\php\pear
log_errors-----On-----On
log_errors_max_len-----1024-----1024
mail.add_x_header-----On-----On
mail.force_extra_parameters-----no value-----no value
mail.log-----no value-----no value
max_execution_time-----300-----300
max_file_uploads-----20-----20
max_input_nesting_level-----64-----64
max_input_time-----60-----60
max_input_vars-----1000-----1000
memory_limit-----1024M-----1024M
open_basedir-----no value-----no value
output_buffering-----4096-----4096
output_handler-----no value-----no value
post_max_size-----200M-----200M
precision-----14-----14
realpath_cache_size-----16K-----16K
realpath_cache_ttl-----120-----120
register_argc_argv-----Off-----Off
report_memleaks-----On-----On
report_zend_debug-----On-----On
request_order-----GP-----GP
sendmail_from-----no value-----no value
sendmail_path-----no value-----no value
serialize_precision-----17-----17
short_open_tag-----Off-----Off
SMTP-----localhost-----localhost
smtp_port-----25-----25
sql.safe_mode-----Off-----Off
track_errors-----On-----On
unserialize_callback_func-----no value-----no value
upload_max_filesize-----20M-----20M
upload_tmp_dir-----C:\windows\Temp-----C:\windows\Temp
user_dir-----no value-----no value
user_ini.cache_ttl-----300-----300
user_ini.filename-----.user.ini-----.user.ini
variables_order-----GPCS-----GPCS
windows.show_crt_warning-----Off-----Off
xmlrpc_error_number-----0-----0
xmlrpc_errors-----Off-----Off
zend.detect_unicode-----On-----On
zend.enable_gc-----On-----On
zend.multibyte-----Off-----Off
zend.script_encoding-----no value-----no value

ctype
ctype functions -----enabled

curl
cURL support -----enabled
cURL Information -----7.24.0
Age -----3
Features
AsynchDNS -----Yes
Debug -----No
GSS-Negotiate -----Yes
IDN -----No
IPv6 -----Yes
Largefile -----Yes
NTLM -----Yes
SPNEGO -----No
SSL -----Yes
SSPI -----Yes
krb4 -----No
libz -----Yes
CharConv -----No
Protocols -----dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host -----i386-pc-win32
SSL Version -----OpenSSL/0.9.8u
ZLib Version -----1.2.5
libSSH Version -----libssh2/1.3.0

date
date/time support -----enabled
“Olson” Timezone Database Version -----2012.3
Timezone Database -----internal
Default timezone -----America/New_York

Directive-----Local Value-----Master Value
date.default_latitude-----31.7667-----31.7667
date.default_longitude-----35.2333-----35.2333
date.sunrise_zenith-----90.583333-----90.583333
date.sunset_zenith-----90.583333-----90.583333
date.timezone-----America/New_York-----America/New_York

dom
DOM/XML -----enabled
DOM/XML API Version -----20031129
libxml Version -----2.7.7
HTML Support -----enabled
XPath Support -----enabled
XPointer Support -----enabled
Schema Support -----enabled
RelaxNG Support -----enabled

ereg
Regex Library -----Bundled library enabled

fileinfo
fileinfo support-----enabled
version -----1.0.5

filter
Input Validation and Filtering -----enabled
Revision -----$Id: e523cdc8829892d1b4f9cb7c3c57b2ba1c36b9ea $

Directive-----Local Value-----Master Value
filter.default-----unsafe_raw-----unsafe_raw
filter.default_flags-----no value-----no value

ftp
FTP support -----enabled

gd
GD Support -----enabled
GD Version -----bundled (2.0.34 compatible)
FreeType Support -----enabled
FreeType Linkage -----with freetype
FreeType Version -----2.4.3
GIF Read Support -----enabled
GIF Create Support -----enabled
JPEG Support -----enabled
libJPEG Version -----6b
PNG Support -----enabled
libPNG Version -----1.2.46
WBMP Support -----enabled
XBM Support -----enabled

Directive-----Local Value-----Master Value
gd.jpeg_ignore_warning-----0-----0

gettext
GetText Support -----enabled

hash
hash support -----enabled
Hashing Engines -----md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b fnv132 fnv164 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv
iconv support -----enabled
iconv implementation -----“libiconv”
iconv library version -----1.11

Directive-----Local Value-----Master Value
iconv.input_encoding-----ISO-8859-1-----ISO-8859-1
iconv.internal_encoding-----ISO-8859-1-----ISO-8859-1
iconv.output_encoding-----ISO-8859-1-----ISO-8859-1

json
json support -----enabled
json version -----1.2.1

libxml
libXML support -----active
libXML Compiled Version -----2.7.7
libXML Loaded Version -----20707
libXML streams -----enabled

mbstring
Multibyte Support -----enabled
Multibyte string engine -----libmbfl
HTTP input encoding translation -----disabled
libmbfl version -----1.3.2

mbstring extension makes use of “streamable kanji code filter and converter”, which is distributed under the GNU Lesser General Public License version 2.1.

Multibyte (japanese) regex support -----enabled
Multibyte regex (oniguruma) version -----4.7.1

Directive-----Local Value-----Master Value
mbstring.detect_order-----no value-----no value
mbstring.encoding_translation-----Off-----Off
mbstring.func_overload-----0-----0
mbstring.http_input-----pass-----pass
mbstring.http_output-----pass-----pass
mbstring.http_output_conv_mimetypes-----^(text/|application/xhtml+xml)-----^(text/|application/xhtml+xml)
mbstring.internal_encoding-----no value-----no value
mbstring.language-----neutral-----neutral
mbstring.strict_detection-----Off-----Off
mbstring.substitute_character-----no value-----no value

mcrypt
mcrypt support-----enabled
mcrypt_filter support-----enabled
Version -----2.5.8
Api No -----20021217
Supported ciphers -----cast-128 gost rijndael-128 twofish cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes arcfour
Supported modes -----cbc cfb ctr ecb ncfb nofb ofb stream

Directive-----Local Value-----Master Value
mcrypt.algorithms_dir-----no value-----no value
mcrypt.modes_dir-----no value-----no value

mhash
MHASH support -----Enabled
MHASH API Version -----Emulated Support

mysql
MySQL Support-----enabled
Active Persistent Links -----0
Active Links -----0
Client API version -----mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $

Directive-----Local Value-----Master Value
mysql.allow_local_infile-----On-----On
mysql.allow_persistent-----On-----On
mysql.connect_timeout-----60-----60
mysql.default_host-----no value-----no value
mysql.default_password-----no value-----no value
mysql.default_port-----no value-----no value
mysql.default_socket-----no value-----no value
mysql.default_user-----no value-----no value
mysql.max_links-----Unlimited-----Unlimited
mysql.max_persistent-----Unlimited-----Unlimited
mysql.trace_mode-----Off-----Off

mysqli
MysqlI Support-----enabled
Client API library version -----mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $
Active Persistent Links -----0
Inactive Persistent Links -----0
Active Links -----0

Directive-----Local Value-----Master Value
mysqli.allow_local_infile-----On-----On
mysqli.allow_persistent-----On-----On
mysqli.default_host-----no value-----no value
mysqli.default_port-----3306-----3306
mysqli.default_pw-----no value-----no value
mysqli.default_socket-----no value-----no value
mysqli.default_user-----no value-----no value
mysqli.max_links-----Unlimited-----Unlimited
mysqli.max_persistent-----Unlimited-----Unlimited
mysqli.reconnect-----Off-----Off

mysqlnd
mysqlnd-----enabled
Version -----mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $
Compression -----supported
SSL -----supported
Command buffer size -----4096
Read buffer size -----32768
Read timeout -----31536000
Collecting statistics -----Yes
Collecting memory statistics -----No
Tracing -----n/a
Loaded plugins -----mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions -----mysql,mysqli
… reached my character limit
[/code]

Ok, to figure out the whether the problem is your configuration, perhaps you can make a normal file upload form and see if it uploads a large file.

The PHP manual has a quick example of uploading files.

If you eliminate the basic file uploading and you can see the $_FILES variable is populated correctly then you know it is probably a round cube issue, if turns out to be a PHP issue then you need to check your fast/cgi settings as the rest of your settings look OK. Also check the permissions / space allowed on your upload_tmp_dir.

Check for php.ini in your windows folder as well, it may have conflicting settings.

thank you so much for taking the time to give advice. I will check out those things and see how it goes!

very strange… this is in my php error log… However… THESE FILES DO EXIST IN THOSE DIRECTORIES!!

[08-Sep-2015 21:13:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.4.4\ext\php_pdo_sqlsrv_54_nts.dll’ - The specified module could not be found.
in Unknown on line 0

[08-Sep-2015 21:13:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.4.4\ext\php_sqlsrv_54_nts.dll’ - The specified module could not be found.
in Unknown on line 0

[08-Sep-2015 21:13:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.4.4\ext\php_com_dotnet.dll’ - The specified module could not be found.
in Unknown on line 0

Update #2:

I can verify that the files being uploaded as an attachment, are being fully uploaded and stored in the wwwroot/temp directory. Once uploaded however, the error occurs, and the files are left in the temp directory.

Ok, your extensions that do not load could be due to the fact that they are not compatible with your current PHP, you may also be missing something

Version 3.0 of the driver requires Microsoft SQL Server 2012 Native Client. You can download Microsoft SQL Server 2012 Native Client from the SQL Server 2012 feature pack page.

You can check the dll files by checking their exact version against the details and version number of the other extensions which do load. To check your settings quickly without fixing the extensions, simply comment those ones out that are not loading.

I suspect that round cube may be trying to copy the uploaded files to some other place and perhaps that is where the issue is, unfortunately I don’t know the inner workings of that library.

So you will need to look for move_uploaded_file in the round cube code. You may be able to determine what is happening from there.

Last resort will be to download Xdebug extension and do a debug run. That’s what I normally do first when I hit an issue where the code is causing the issues.

I’m pretty sure the dll’s are the correct version, but I’ll do what you said. I’ll check the code and try the debug if needed. I wish these things had better error reporting and logging. But thanks again for your help. I truly appreciate it

Sure, if your dlls are correct then it will be other dlls that are missing. You may need to install Visual Studio run times. Looking at the ones that are not loading it is probably a run time issue. Good luck with the debugging!

Thanks for all the help… I figured it out! I did your experiment and created a simple php upload form. It was succcessful. This pointed to a problem soley with roundcube. I disabled plugins until I found the culprit “filesystem_attachments”. That’s it… problem solved :slight_smile:

Well done! Another mystery solved!

Sponsor our Newsletter | Privacy Policy | Terms of Service