Ticket #1496: dl.diff

File dl.diff, 1.1 KB (added by masquerade, 7 years ago)
  • wp-settings.php

     
    3434if ( !(phpversion() >= '4.1') ) 
    3535        die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); 
    3636 
    37 if ( !extension_loaded('mysql') ) 
    38         die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); 
    39  
     37if ( !extension_loaded('mysql') ) { 
     38        if(!(phpversion() >= '5.0') || ini_get('safe_mode') == true) 
     39                die('Your PHP installation appears to be missing the mysql module which is required for WordPress.'); 
     40        if(defined('PHP_SHLIB_SUFFIX')) 
     41                $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; 
     42        else { 
     43                if(strtolower(substr(PHP_OS, 0, 3)) == 'win') { 
     44                        $prefix = 'php_'; 
     45                        define('PHP_SHLIB_SUFFIX', 'dll'); 
     46                } else 
     47                        define('PHP_SHLIB_SUFFIX', 'so'); 
     48        } 
     49        if(!dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX)) 
     50                die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); 
     51} 
     52         
    4053function timer_start() { 
    4154        global $timestart; 
    4255        $mtime = explode(' ', microtime() );