Topic on Project:Support desk

Darious-346 (talkcontribs)

Hello,

I have successfully installed mediawiki but it doesn't look like the mediawiki page. Instead, the page looks only with text and links. At the top appears this message twice:

Notice: Undefined offset: 1 in /Applications/XAMPP/xamppfiles/htdocs/nomon/includes/objectcache/MemcachedClient.php on line 748

I checked the file and this is line 748 of MemcachedClient.php: list( $ip, $port ) = preg_split( '/:(?=\d)/', $host );

I don't know the problem however. So if someone could help me I would be very grateful.

Thank you

87.123.19.225 (talkcontribs)

In that line, preg_split() is used to split $host. The result should be exactly two parts and these parts are then put in $ip and in $port.

This problem happens when $host contains something, that the preg_split() does not split into two parts.

So: What is inside $host and is that correct?

Darious-346 (talkcontribs)

Thank you for your quick response.

This what I found inside $host: $host = array_search( $sock, $this->_cache_sock );

Although I'm not sure if that is what you are asking for. I also don't know if is correct or not.

This is the part where I found it:

function _close_sock( $sock ) { $host = array_search( $sock, $this->_cache_sock ); fclose( $this->_cache_sock[$host] ); unset( $this->_cache_sock[$host] ); }// }}} // {{{ _connect_sock()/** * Connects $sock to $host, timing out after $timeout * * @param int $sock Socket to connect * @param string $host Host:IP to connect to * * @return bool * @access private */ function _connect_sock( &$sock, $host ) { list( $ip, $port ) = preg_split( '/:(?=\d)/', $host ); $sock = false; $timeout = $this->_connect_timeout; $errno = $errstr = null; for ( $i = 0; !$sock && $i < $this->_connect_attempts; $i++ ) { MediaWiki\suppressWarnings(); if ( $this->_persistent == 1 ) { $sock = pfsockopen( $ip, $port, $errno, $errstr, $timeout ); } else { $sock = fsockopen( $ip, $port, $errno, $errstr, $timeout ); } MediaWiki\restoreWarnings(); } if ( !$sock ) { $this->_error_log( "Error connecting to $host: $errstr\n" ); $this->_dead_host( $host ); return false; }

Reply to "Undefined offset: 1"