Pessoal,
Estou com um problema com timeout de consulta via php.
Esse problema acontece exporadicamente, tenho tudo instalado perfeitamente. Porém estou com o servidor em uma máquina virtual, VMWARE.
Se eu altero que o arquivo de configuração do freetds e reinicio a máquina volta a funcionar sem o timeout.
Na minha máquina local esse problema não ocorre. Já comparei as configurações e estão exatamente iguais.
Tenho instalado: PHP5 Apache2 freetds tudo na última versão do ubuntu.
PS: Tirei algumas linhas para entrar no post.
Segue a configuração do PHP(phpinfo):
PHP Version 5.3.5-1ubuntu7.2
System Linux srvi007 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686
Build Date May 2 2011 23:04:25
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d
Additional .ini files parsed /etc/php5/apache2/conf.d/gd.ini, /etc/php5/apache2/conf.d/imagick.ini, /etc/php5/apache2/conf.d/mssql.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_dblib.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/pdo_pgsql.ini, /etc/php5/apache2/conf.d/pgsql.ini
PHP API 20090626
PHP Extension 20090626
Directive Local Value Master Value
engine 1 1
last_modified 0 0
xbithack 0 0
Apache Environment
Variable Value
HTTP_HOST 192.168.0.64
HTTP_USER_AGENT Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE 115
HTTP_COOKIE PHPSESSID=nthth8i3blr2l3819eb8nu3o11
HTTP_VIA 1.1 proxy.superimec.com.br (squid/3.0.STABLE13)
HTTP_X_FORWARDED_FOR 192.168.0.178
HTTP_CACHE_CONTROL max-age=259200
HTTP_CONNECTION keep-alive
PATH /usr/local/bin:/usr/bin:/bin
SERVER_SIGNATURE <address>Apache/2.2.17 (Ubuntu) Server at 192.168.0.64 Port 80</address>
SERVER_SOFTWARE Apache/2.2.17 (Ubuntu)
SERVER_NAME 192.168.0.64
SERVER_ADDR 192.168.0.64
SERVER_PORT 80
REMOTE_ADDR 192.168.0.253
DOCUMENT_ROOT /var/www
Host 192.168.0.64
User-Agent Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Cache-Control max-age=259200
Connection keep-alive
HTTP Response Headers
X-Powered-By PHP/5.3.5-1ubuntu7.2
Vary Accept-Encoding
Content-Encoding gzip
Core
PHP Version 5.3.5-1ubuntu7.2
Directive Local Value Master Value
allow_call_time_pass_reference Off Off
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
define_syslog_variables Off Off
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
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 30711 30711
exit_on_timeout Off Off
expose_php On On
extension_dir /usr/lib/php5/20090626+lfs /usr/lib/php5/20090626+lfs
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors Off Off
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/share/php:/usr/share/pear .:/usr/share/php:/usr/share/pear
log_errors On On
log_errors_max_len 1024 1024
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.add_x_header On On
mail.force_extra_parameters no value no value
mail.log no value no value
max_execution_time 3000 3000
max_file_uploads 30 30
max_input_nesting_level 64 64
max_input_time -1 -1
memory_limit 1528M 1528M
open_basedir no value no value
output_buffering 4096 4096
output_handler no value no value
post_max_size 38M 38M
precision 14 14
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv Off Off
register_globals Off Off
register_long_arrays Off Off
report_memleaks On On
report_zend_debug On On
request_order GP GP
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 32M 32M
upload_tmp_dir no value no value
user_dir no value no value
user_ini.cache_ttl 300 300
user_ini.filename .user.ini .user.ini
variables_order GPCS GPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.enable_gc On On
ctype
ctype functions enabled
dba
DBA support enabled
Supported handlers cdb cdb_make db4 inifile flatfile
Directive Local Value Master Value
dba.default_handler flatfile flatfile
dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.8
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
ereg
Regex Library Bundled library enabled
exif
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
Directive Local Value Master Value
exif.decode_jis_intel JIS JIS
exif.decode_jis_motorola JIS JIS
exif.decode_unicode_intel UCS-2LE UCS-2LE
exif.decode_unicode_motorola UCS-2BE UCS-2BE
exif.encode_jis no value no value
exif.encode_unicode ISO-8859-15 ISO-8859-15
fileinfo
fileinfo support enabled
version 1.0.5-dev
Directive Local Value Master Value
gd.jpeg_ignore_warning 0 0
gettext
GetText Support enabled
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
imagick
imagick module enabled
imagick module version 3.0.0RC1
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version ImageMagick 6.6.2-6 2011-03-16 Q16 http://www.imagemagick.org
ImageMagick copyright Copyright (C) 1999-2010 ImageMagick Studio LLC
ImageMagick release date 2011-03-16
ImageMagick number of supported formats: 198
ImageMagick supported formats 3FR, A, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BMP, BMP2, BMP3, BRF, BRG, C, CAL, CALS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FRACTAL, FTS, G, G3, GBR, GIF, GIF87, GRADIENT, GRAY, GRB, GROUP4, HALD, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, J2C, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RBG, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV
Directive Local Value Master Value
imagick.locale_fix 0 0
imagick.progress_monitor 0 0
json
json support enabled
json version 1.2.1
libxml
libXML support active
libXML Compiled Version 2.7.8
libXML Loaded Version 20708
libXML streams enabled
mbstring
Multibyte Support enabled
Multibyte string engine libmbfl
HTTP input encoding translation disabled
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) backtrack check On
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
mhash
MHASH support Enabled
MHASH API Version Emulated Support
mssql
MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version FreeTDS
Directive Local Value Master Value
mssql.allow_persistent On On
mssql.batchsize 0 0
mssql.charset no value no value
mssql.compatability_mode Off Off
mssql.connect_timeout 3000 3000
mssql.datetimeconvert On On
mssql.max_links Unlimited Unlimited
mssql.max_persistent Unlimited Unlimited
mssql.max_procs Unlimited Unlimited
mssql.min_error_severity 10 10
mssql.min_message_severity 10 10
mssql.secure_connection Off Off
mssql.textlimit Server default Server default
mssql.textsize Server default Server default
mssql.timeout 3060 3060
pdo_pgsql
PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 8.4.8
Module version 1.0.2
Revision $Id: pdo_pgsql.c 300351 2010-06-10 12:11:19Z iliaa $
Phar
Phar: PHP Archive support enabled
Phar EXT version 2.0.1
Phar API version 1.1.1
SVN revision $Revision: 305584 $
Phar-based phar archives enabled
Tar-based phar archives enabled
ZIP-based phar archives enabled
gzip compression enabled
bzip2 compression enabled
OpenSSL support enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive Local Value Master Value
phar.cache_list no value no value
phar.readonly On On
phar.require_hash On On
posix
Revision $Revision: 305507 $
Reflection
Reflection enabled
Version $Revision: 305605 $
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 1800 1800
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 14400 14400
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/lib/php5 /var/lib/php5
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0
shmop
shmop support enabled
SimpleXML
Simplexml support enabled
Revision $Revision: 302715 $
Schema support enabled
soap
Soap Client enabled
Soap Server enabled
Directive Local Value Master Value
soap.wsdl_cache 1 1
soap.wsdl_cache_dir /tmp /tmp
soap.wsdl_cache_enabled 1 1
soap.wsdl_cache_limit 5 5
soap.wsdl_cache_ttl 86400 86400
sockets
Sockets Support enabled
SPL
SPL support enabled
Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
standard
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i
Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 2600 2600
from no value no value
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry
user_agent no value no value
sysvmsg
sysvmsg support enabled
Revision $Revision: 303429 $
tokenizer
Tokenizer Support enabled
wddx
WDDX Support enabled
WDDX Session Serializer enabled
xml
XML Support active
XML Namespace Support active
libxml2 Version 2.7.8
xmlreader
XMLReader enabled
xmlwriter
XMLWriter enabled
zip
Zip enabled
Extension Version $Id: php_zip.c 305848 2010-11-30 11:04:06Z pajoye $
Zip version 1.9.1
Libzip version 0.9.0
zlib
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.1.1
Linked Version 1.2.3.4
Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value
Additional Modules
Module Name
sysvsem
sysvshm
Environment
Variable Value
APACHE_RUN_DIR /var/run/apache2
APACHE_PID_FILE /var/run/apache2.pid
PATH /usr/local/bin:/usr/bin:/bin
APACHE_LOCK_DIR /var/lock/apache2
LANG C
APACHE_RUN_GROUP www-data
APACHE_RUN_USER www-data
APACHE_LOG_DIR /var/log/apache2
PWD /
PHP Variables
Variable Value
_COOKIE["PHPSESSID"] nthth8i3blr2l3819eb8nu3o11
_SERVER["HTTP_HOST"] 192.168.0.64
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
_SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_LANGUAGE"] pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"] 115
_SERVER["HTTP_COOKIE"] PHPSESSID=nthth8i3blr2l3819eb8nu3o11
_SERVER["HTTP_VIA"] 1.1 proxy.superimec.com.br (squid/3.0.STABLE13)
_SERVER["HTTP_X_FORWARDED_FOR"] 192.168.0.178
_SERVER["HTTP_CACHE_CONTROL"] max-age=259200
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["PATH"] /usr/local/bin:/usr/bin:/bin
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.2.17 (Ubuntu) Server at 192.168.0.64 Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache/2.2.17 (Ubuntu)
_SERVER["SERVER_NAME"] 192.168.0.64
_SERVER["SERVER_ADDR"] 192.168.0.64
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 192.168.0.253
_SERVER["DOCUMENT_ROOT"] /var/www
_SERVER["SERVER_ADMIN"] webmaster@localhost
_SERVER["SCRIPT_FILENAME"] /var/www/sispeddist/phpinfo.php
_SERVER["REMOTE_PORT"] 47143
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.0
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /sispeddist/phpinfo.php
_SERVER["SCRIPT_NAME"] /sispeddist/phpinfo.php
_SERVER["PHP_SELF"] /sispeddist/phpinfo.php
_SERVER["REQUEST_TIME"] 1308054042
PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
////////////////////////
Configuração do Freetds:
cat /etc/freetds/freetds.conf
# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
; tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
timeout = 1010
connect timeout = 1010
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0
# A typical Microsoft server
[egServer70]
host = ntmachine.domain.com
port = 1433
tds version = 7.0