Перейти к контенту
  • 0

Ошибки в админ панели Unable to automatically create the FULLTEXT inde


Вопрос

Имею:

Версия IPB v2.2.2 (ID: 22011)

Версия SQL MYSQL (4.0.24_Debian-10sarge2)

Версия PHP 4.4.4-8 (apache2handler) ( PHP INFO )

 

После переезда с другого хостинга в админ панели в разделе Настройка вываливается следующее:

 

onf_title_count=conf_title_count+1', 'where' => 'conf_title_id='.$this->ipsclass->input['conf_group'] ) ); } else { $this->ipsclass->DB->do_update( 'conf_settings', $array, 'conf_id='.intval($this->ipsclass->input['id']) ); $this->ipsclass->main_msg = 'Системная настройка изменена'; } $this->setting_rebuildcache(); $this->setting_view(); } //----------------------------------------- // Settings Revert //----------------------------------------- function setting_revert() { $this->ipsclass->input['id'] = intval($this->ipsclass->input['id']); if ( ! $this->ipsclass->input['id'] ) { $this->ipsclass->main_msg = "Вы должны ввести ID системной настройки"; $this->setting_form(); } $conf = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => 'conf_id='.$this->ipsclass->input['id'] ) ); //----------------------------------------- // Revert... //----------------------------------------- $this->ipsclass->DB->simple_exec_query( array( 'update' => 'conf_settings', 'set' => "conf_value=''", 'where' => 'conf_id='.$this->ipsclass->input['id'] ) ); $this->ipsclass->main_msg = "Системная настройка возвращена к первоначальному виду."; $this->setting_rebuildcache(); $this->setting_view(); } //----------------------------------------- // Settings Delete //----------------------------------------- function setting_delete() { if ( ! $this->ipsclass->input['id'] ) { $this->ipsclass->main_msg = "Вы должны ввести ID системной настройки"; $this->setting_form(); } $conf = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => 'conf_id='.intval($this->ipsclass->input['id']) ) ); //----------------------------------------- // Delete... //----------------------------------------- $this->ipsclass->DB->simple_exec_query( array( 'delete' => 'conf_settings', 'where' => 'conf_id='.intval($this->ipsclass->input['id']) ) ); $this->ipsclass->DB->simple_exec_query( array( 'update' => 'conf_settings_titles', 'set' => 'conf_title_count=conf_title_count-1', 'where' => 'conf_title_id='.$conf['conf_group'] ) ); $this->ipsclass->main_msg = "Системная настройка удалена"; $this->setting_rebuildcache(); $this->ipsclass->input['conf_group'] = $conf['conf_group']; $this->setting_view(); } //----------------------------------------- // BBCODE Rebuild Cache //----------------------------------------- function setting_rebuildcache() { $this->ipsclass->cache['settings'] = array(); $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'conf_settings', 'where' => 'conf_add_cache=1' ) ); $info = $this->ipsclass->DB->simple_exec(); while ( $r = $this->ipsclass->DB->fetch_row($info) ) { $value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default']; if ( $value == '{blank}' ) { $value = ''; } $this->ipsclass->cache['settings'][ $r['conf_key'] ] = $this->ipsclass->txt_stripslashes($value); $this->ipsclass->vars[ $r['conf_key'] ] = $this->ipsclass->cache['settings'][ $r['conf_key'] ]; } $this->ipsclass->update_cache( array( 'name' => 'settings', 'array' => 1, 'deletefirst' => 1 ) ); } //----------------------------------------- // Setting get cache //----------------------------------------- function setting_get_groups() { $this->setting_groups = array(); if ( IN_DEV ) { $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'conf_settings_titles', 'order' => 'conf_title_title' ) ); $this->ipsclass->DB->simple_exec(); } else { $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'conf_settings_titles', 'where' => 'conf_title_noshow=0', 'order' => 'conf_title_title' ) ); $this->ipsclass->DB->simple_exec(); } while( $r = $this->ipsclass->DB->fetch_row() ) { $this->setting_groups[ $r['conf_title_id'] ] = $r; $this->setting_groups_by_key[ $r['conf_title_keyword'] ] = $r; } } //----------------------------------------- // Make drop down of available titles //----------------------------------------- function setting_make_dropdown() { if ( ! is_array( $this->setting_groups ) ) { $this->setting_get_groups(); } $ret = ""; foreach( $this->setting_groups as $id => $data ) { $ret .= ( $id == $this->ipsclass->input['conf_group'] ) ? "{$data['conf_title_title']}" : "{$data['conf_title_title']}"; } return $ret."\n"; } //----------------------------------------- // Save full text options //----------------------------------------- function do_fulltext() { $this->ipsclass->admin-> get_mysql_version(); if ( $this->ipsclass->DB->sql_can_fulltext() ) { // How many posts do we have? $this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(*) as cnt', 'from' => 'posts' ) ); $this->ipsclass->DB->simple_exec(); $result = $this->ipsclass->DB->fetch_row(); // If over 15,000 posts... if ( $result['cnt'] > 15000 ) { // Explain how, why and what to do.. $this->ipsclass->admin->page_detail = ""; $this->ipsclass->admin->page_title = "Продолжение невозможно"; $this->ipsclass->html .= $this->return_sql_no_no_cant_do_it_sorry_text(); $this->ipsclass->admin->output(); } else { // Index away! $this->ipsclass->DB->sql_add_fulltext_index( 'topics', 'title' ); $this->ipsclass->DB->sql_add_fulltext_index( 'posts' , 'post' ); } } else { $this->ipsclass->admin->error("Извините, ваша версия MySQL не поддерживает поиск по полному тексту"); } $this->ipsclass->admin->save_log("Обновлены настройки поиска по полному тексту"); $this->ipsclass->admin->done_screen("Индексы поиска по полному тексты обновлены", "Настройки поиска по полному тексту", "{$this->ipsclass->form_code}&code=setting_view&conf_group=19", "redirect" ); } /*-------------------------------------------------------------------------*/ // Checks all the settings titles to ensure they have a key associated. /*-------------------------------------------------------------------------*/ function setting_titles_check() { //----------------------------------------- // Get 'em //----------------------------------------- $this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'conf_settings_titles' ) ); $outer = $this->ipsclass->DB->exec_query(); while( $row = $this->ipsclass->DB->fetch_row( $outer ) ) { if ( ! $row['conf_title_keyword'] ) { $new_keyword = strtolower( preg_replace( "#[^\d\w]#", "", $row['conf_title_title'] ) ); $this->ipsclass->DB->do_update( 'conf_settings_titles', array( 'conf_title_keyword' => $new_keyword ), 'conf_title_id='.$row['conf_title_id'] ); } } } //----------------------------------------- // // Save config. Does the hard work, so you don't have to. // //----------------------------------------- /** * @deprecated */ function save_config( $new ) { $master = array(); if ( is_array($new) ) { if ( count($new) > 0 ) { foreach( $new as $field ) { // Handle special.. if ($field == 'img_ext' or $field == 'avatar_ext' or $field == 'photo_ext') { $_POST[ $field ] = preg_replace( "/[\.\s]/", "" , $_POST[ $field ] ); $_POST[ $field ] = str_replace('|', "|", $_POST[ $field ]); $_POST[ $field ] = preg_replace( "/,/" , '|', $_POST[ $field ] ); } else if ($field == 'coppa_address') { $_POST[ $field ] = nl2br( $_POST[ $field ] ); } if ( $field == 'gd_font' OR $field == 'html_dir' OR $field == 'upload_dir') { $_POST[ $field ] = str_replace( "'", "'", $_POST[ $field ] ); } else { $_POST[ $field ] = str_replace( "'", "'", stripslashes($_POST[ $field ]) ); } $master[ $field ] = stripslashes($_POST[ $field ]); } $this->ipsclass->admin->rebuild_config($master); } } $this->ipsclass->admin->save_log("Обновлены настройки форума, Back Up записан"); $this->ipsclass->admin->done_screen("Конфигурация обновлена", "Начало Админцентра", "act=index" ); } function return_sql_no_no_cant_do_it_sorry_text() { return " 
Unable to automatically create the FULLTEXT indexes 

You have too many posts for an automatic FULLTEXT index creation. It is more than likely that PHP will time out before the indexes are complete which could cause some index corruption. 
Creating FULLTEXT indexes is a relatively slow process but it's one that's worth doing as it will save you a lot of time and CPU power when your members search. 
On average, a normal webserver is capable of indexing about 80,000 posts an hour but it is a relatively intense process. If you are using MySQL 4.0.12+ then this time is reduced substaintially. 

How to manually create the indexes 
If you have shell (SSH / Telnet) access to mysql, the process is very straightforward. If you do not have access to shell, then you will have to contact your webhost and ask them to do this for you. 

Step 1: Initiate mysql 
In shell type: 

mysql -u{your_sql_user_name} -p{your_sql_password}

Your MySQL username and password can be found in your conf_global.php file 

Step 2: Select your database 
In mysql type: 

use {your_database_name_here};

Make sure you use a trailing semi-colon. Your MySQL database name can be found in conf_global.php 

Step 3: Indexing the topics table 
In mysql type: 

alter table ibf_topics add fulltext(title);

If you are not using 'ibf_' as your table extension, adjust that query to suit. This query can take a while depending on the number of topics you have. 

Step 4: Indexing the posts table 
In mysql type: 

alter table ibf_posts add fulltext(post);

If you are not using 'ibf_' as your table extension, adjust that query to suit. This query can take a while depending on the number of posts you have. On average MySQL can index 80,000 posts an hour. If you are using MySQL 4, the time is greatly reduced. 
"; } function settinggroup_export() { if( empty( $this->ipsclass->input['conf_group'] ) ) { return; } /** * Santy */ $this->ipsclass->input['conf_group'] = intval($this->ipsclass->input['conf_group']); /** * Require the XML class */ require_once( KERNEL_PATH . 'class_xml.php' ); $xml = new class_xml(); /** * Set the root tag */ $xml->xml_set_root( 'settingexport', array( 'exported' => time() ) ); /** * Create base group */ $xml->xml_add_group( 'settinggroup' ); /** * Grab title keyword first */ $conf_title = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'conf_title_title, conf_title_desc, conf_title_noshow, conf_title_keyword, conf_title_module', 'from' => 'conf_settings_titles', 'where' => "conf_title_id = {$this->ipsclass->input['conf_group']}" ) ); /** * Die? */ if ( ! $conf_title ) { return; } /** * Create Content */ foreach( $conf_title as $field_name=>$field_value ) { $content[] = $xml->xml_build_simple_tag( $field_name, $field_value ); } $content[] = $xml->xml_build_simple_tag( 'conf_is_title', 1 ); $entry[] = $xml->xml_build_entry( 'setting', $content ); /** * Grab settings */ $this->ipsclass->DB->simple_select( '*', 'conf_settings', "conf_group = {$this->ipsclass->input['conf_group']}" ); $this->ipsclass->DB->exec_query(); if( $this->ipsclass->DB->get_num_rows() ) { while( $row = $this->ipsclass->DB->fetch_row() ) { unset( $content ); foreach( $row as $field_name=>$field_value ) { $content[] = $xml->xml_build_simple_tag( $field_name, $field_value ); } $content[] = $xml->xml_build_simple_tag( 'conf_title_keyword', $conf_title['conf_title_keyword'] ); $content[] = $xml->xml_build_simple_tag( 'conf_is_title', 0 ); $entry[] = $xml->xml_build_entry( 'setting', $content ); } $xml->xml_add_entry_to_group( 'settinggroup', $entry ); } /** * Format */ $xml->xml_format_document(); /** * Send to browser */ $this->ipsclass->admin->show_download( $xml->xml_document, 'mod_settings.xml', '', 0 ); } } ?>

 

В остальном все отлично. Как это вылечить?

Ссылка на комментарий
Поделиться на других сайтах

Рекомендуемые сообщения

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.