Reputation: 192
I just installed a new version of XAMPP and the site that used to work perfectly now no longer works, I suppose it's a PHP incompatibility, can anyone help me? tnks in adv..
Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_gpc() in D:\xampp\htdocs\index.php:207 Stack trace: #0 {main} thrown in D:\xampp\htdocs\index.php on line 207
\\ The path to the "application" folder
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
if(get_magic_quotes_gpc())
{
function stripslashes_gpc(&$value)
{
$value = stripslashes($value);
}
array_walk_recursive($_GET, 'stripslashes_gpc');
array_walk_recursive($_POST, 'stripslashes_gpc');
array_walk_recursive($_COOKIE, 'stripslashes_gpc');
array_walk_recursive($_REQUEST, 'stripslashes_gpc');
}
thanks @WiatroBosy for your help.
I think I solved the problem because the message has now changed and has diverted the error to another file.. I solved the first problem like this..(I don't know if I did it right)
if( function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc())
The new error now is:
Fatal error: Cannot declare class CI_Log, because the name is already in use in D:\xampp\htdocs\system\libraries\Log.php on line 27 (line 27) class CI_Log {
Upvotes: 15
Views: 76175
Reputation: 1124
This function has been DEPRECATED as of PHP 7.4.0 and REMOVED in 8.0.0.
Hence you should just remove this function call from the code, along with entire condition where it's used.
Read the documentation of get_magic_quotes_gpc()
Upvotes: 18
Reputation: 875
Add this function to your php file
if (!function_exists('get_magic_quotes_gpc')) {
function get_magic_quotes_gpc()
{
// Check if magic quotes GPC emulation is needed
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
return (bool) ini_get('magic_quotes_gpc');
} else {
return false; // Magic quotes GPC is deprecated and not available
}
}
}
Upvotes: 0