There has been a bug discovered in the MySQLi extension for PHP that causes a Segmentation fault error on some installations of PHP when the mysqli_result::fetch_fields function is used.
Error occurred on a Linux server using the following software:
1 PHP Version: PHP 5.3.6
2 Operating System: CentOS release 5.6 (Final)
3 Mysql Version : 5.0.92-community
The error manifests in a few ways:
- 1 At step 3 of the installation process, the process terminates and users are forwarded to step 1.
- 2 At step 2 of the upgrade process, a 500 error is thrown by Apache. In the error logs you may see errors like:
Premature end of script headers: index.php, referer: http://domain.com/install/manage/select)
On some servers, the 500 error is masked by a “Page Not Found” message from SocialEngine.
- 3 The Other Tools > Requirement and Dependency Check page of the package manager will produce similar results as #2.
Fix:
If you are experiencing this error while performing an upgrade, download the engine4_r9166.zip attached to this article and extract its contents.
Next, using an FTP client, upload the application folder into your SocialEngine root directory, so that the application/libraries/Engine/Sanity/Test/MysqlEngine.php file is overwritten.
To apply the patch manually, make the following changes:
Edit the file application/libraries/Engine/Sanity/Test/MysqlEngine.php and around line 82, locate the lines of code that look like this:
// Try to list engines try { $data = $adapter->query('SHOW ENGINES')->fetchAll(); } catch( Exception $e ) { return $this->_error('badAdapter'); } [/code] Replace this block of code with:
[code][/code]
// Try to list engines if( $adapter instanceof Zend_Db_Adapter_Mysqli ){ // Fixes MySQLI segfault in fetch_fields() with SHOW ENGINES $connection = $adapter->getConnection(); $result = mysqli_query($connection, 'SHOW ENGINES'); if ( !$result instanceof mysqli_result ){ return $this->_error('badAdapter'); } $data = array(); while ( $row = $result->fetch_array() ){ $data[] = $row; } } else { try { $data = $adapter->query('SHOW ENGINES')->fetchAll(); } catch( Exception $e ) { return $this->_error('badAdapter'); } }
Looking for quality Social Engine Web Hosting? Look no further than Arvixe Web Hosting!