0
I was installing a site, after all completed I open the site and I come across this error:
Fatal error: Uncaught Error: Call to Undefined Function mysql_select_db() in /home/imwfzgbi/public_html/config/config.php:19 Stack trace: #0 /home/imwfzgbi/public_html/index.php(15): include() #1 {main} thrown in /home/imwfzgbi/public_html/config/config.php on line 19
Config.php:
<?php
    $siteA = 'http://'.$_SERVER['SERVER_NAME'].'/';
    $siteB = '/';
    $email_suporte_staff = '[email protected]';
    global $siteB;
    global $siteA;
    $config_bd = array(
        'host' => 'localhost',
        'db' => 'imwfzgbi_ultra',
        'usuario' => 'imwfzgbi_flix',
        'senha' => 'ultraflixbr',
    );
    $conect = mysql_connect($config_bd['host'], $config_bd['usuario'], $config_bd['senha']);
    if($conect)
    {
        mysql_select_db($config_bd['db']);
        mysql_set_charset('utf8');
    }
    else
    {
        echo '<center><b>config/config.php</b> nao configurado.</center>';
        exit;
    }
?>
These are the files with the supposed error. Can anyone help me?
What version of PHP are you using?
– Luiz Felipe
PHP version: 5.6
– DarkShadow ULS
Make sure the
mysql_*is entitled to php.ini (utilizephpinfo();for that reason). Why should we not use mysql type functions_*?– Valdeir Psr
cPanel-generated php ini Directives, do not Edit ; Manual Editing of this file may result in Unexpected behavior. ; To make changes to this file, use the cPanel Multiphp INI Editor (Home >> Software >> Multiphp INI Editor) ; For more information, read our Documentation (https://go.cpanel.net/EA4ModifyINI) display_errors = Off max_execution_time = 200 max_input_time = -1
max_input_vars = 10000
memory_limit = 1024M
post_max_size = 128M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php70"
upload_max_filesize = 128M
zlib.output_compression = Off
– DarkShadow ULS
this and php.ini
– DarkShadow ULS
mysql driver has been obsolete for a few years. Use Mysqli, or PDO
– Sveen