Problems with magic_quotes

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problems with magic_quotes

Postby theflyingdutch » 04. January 2017 23:39

Hello there !
Im using xampp v3.2.2 ( 7.0.13 / PHP 7.0.13 ) - Windows 10 and I have the following problem :
When I try to run my script it says :
Fatal error: Cannot redeclare get_magic_quotes_gpc() in C:\xampp\htdocs\includes\defines.inc.php on line 87
On this line in that file I have:
if (version_compare(PHP_VERSION, '6.0.0') >= 0) {
function get_magic_quotes_gpc(){
return false;
}
}

Whenever I try to edit the .ini file ( I check which one I'm using from phpinfo script )I set the magic_quotes_gpc=Off to magic_quotes_gpc=On ( I tried also with space between = on etc..) and its not working.. whenever I try to start the apache from the xamp panel windows say that apache cannot start..
I tried different ways that I found in the internet but its not working.. also if I remove this from my script, then the entire script is not working..
Help me please..
theflyingdutch
 
Posts: 3
Joined: 04. January 2017 23:32
XAMPP version: v3.2.2
Operating System: Widnwos 10

Re: Problems with magic_quotes

Postby Altrea » 04. January 2017 23:49

Hi,

Start using the PHP Manual, it's a life saver.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Problems with magic_quotes

Postby theflyingdutch » 05. January 2017 10:24

Yea I know but for now I need them for a tests etc..
theflyingdutch
 
Posts: 3
Joined: 04. January 2017 23:32
XAMPP version: v3.2.2
Operating System: Widnwos 10

Re: Problems with magic_quotes

Postby Altrea » 05. January 2017 10:44

Then you need to use a XAMPP version containing PHP version lower than 5.4. There is no other way. The functionality was removed completely.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Problems with magic_quotes

Postby Nobbie » 05. January 2017 12:19

Altrea wrote:Then you need to use a XAMPP version containing PHP version lower than 5.4. There is no other way. The functionality was removed completely.


No!!!

You did not read the error carefully - it is just vice verse: the get_magic_quotes_gpc() HAD been removed for PHP6 only, but it is back again in PHP7. See http://php.net/manual/en/function.get-m ... es-gpc.php

And this is actually the error message, in the PHP Code there is a faulty if-clause comparing if PHP6 or higher is running and in that case, a user-defined get_magic_quotes_gpc() is declared. But for PHP7 (which is higher than 6.0.0) this collides with the already existing function get_magic_quotes_gpc(), exactly what the error message says: Fatal error: Cannot redeclare get_magic_quotes_gpc()

The solution is quit simple, simply remove that 5 lines of code in the PHP script and thats it!
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Problems with magic_quotes

Postby Altrea » 05. January 2017 12:53

Nobbie wrote:
Altrea wrote:Then you need to use a XAMPP version containing PHP version lower than 5.4. There is no other way. The functionality was removed completely.


No!!!

You did not read the error carefully - it is just vice verse: the get_magic_quotes_gpc() HAD been removed for PHP6 only, but it is back again in PHP7. See http://php.net/manual/en/function.get-m ... es-gpc.php

You are right, the check function returns with PHP 7 which causes this error message. But the part why i wrote my reply was this one:
theflyingdutch wrote:Whenever I try to edit the .ini file ( I check which one I'm using from phpinfo script )I set the magic_quotes_gpc=Off to magic_quotes_gpc=On ( I tried also with space between = on etc..) and its not working.. whenever I try to start the apache from the xamp panel windows say that apache cannot start..

The check function might be back, but the magic_quotes functionality is still removed. Adding or enabling it in the php.ini will not bring it back.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Problems with magic_quotes

Postby Nobbie » 05. January 2017 13:21

Altrea wrote:The check function might be back, but the magic_quotes functionality is still removed.


Of course. the "functionality" of get_magic_quotes_gpc() already had been reduced to a simple "return FALSE" since PHP 5.4. There is no functionality in any means, exactly what the user-defined function above also does. Therefore simply remove that if-clause. But the function itself had been removed in PHP6, but this has been reverted in PHP7 (probably due to many requests).
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Problems with magic_quotes

Postby Altrea » 05. January 2017 13:52

PHP 6 has never been released so i would agree that this replacement function is useless.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Problems with magic_quotes

Postby theflyingdutch » 05. January 2017 22:43

Okay guys, now I know.. somebody can tell me from where I can download xampp with php 5.4 <
Thanks.
theflyingdutch
 
Posts: 3
Joined: 04. January 2017 23:32
XAMPP version: v3.2.2
Operating System: Widnwos 10

Re: Problems with magic_quotes

Postby Altrea » 05. January 2017 23:35

From here: https://sourceforge.net/projects/xampp/files/
The last XAMPP version containing PHP 5.4.X was XAMPP 1.8.2-6
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 277 guests