imap - How to override php.ini timeout for imap_timeout functionality with secure POP3 servers -


the php imap library doesn't have built in ways change imap_timeout function secure pop3 connections. i'm looking build functionality can set timeout 1 second connections secure pop3 servers, i'm not sure start learn overriding php.ini command within php function. ideas?

imap_timeout(1, ) works fine pop3 connections, but apparently not pop3s (ssl, port 995) connections, default socket timeout still applies. applies php 4.3.10, not tested on other versions.


we looked source find out function , how use it. the function overrides default_socket_timeout setting php.ini file

you can retrieve current timeout length each timeout type calling function as:

imap_timeout(timeout_type); or imap_timeout(timeout_type,-1);

you can set timeout length of timeout types setting timeout value number of seconds.

imap_timeout(timeout_type,);

the timeout types follows:

1: open 2: read 3: write 4: close

it not appear close type has been implemented.

source: https://students.kiv.zcu.cz/doc/php5/manual/cs/function.imap-timeout.php.html

use default_socket_timeout

here small demonstration override default configuration.

ini_set('default_socket_timeout', 2); // socket based code here  // restore default socket timeout ini_restore('default_socket_timeout'); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -