Call to undefined function set_magic_quotes_runtime() [closed] - php

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
So, on my website I'm getting this error:
Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /homepages/4/d661770438/htdocs/awptical/initdata.php:382 Stack trace: #0 /homepages/4/d661770438/htdocs/awptical/index.php(21): require_once() #1 {main} thrown in /homepages/4/d661770438/htdocs/awptical/initdata.php on line 382
Does anybody know what this means?

The function no longer exists in PHP 7, nor the setting it works with, so you will need to remove its usages. You will need to save the current state of your code and try to remove all the instances of this function call and see whether the site is working and if so, whether it is working as you expect it to work. Alternatively, you can implement a dummy version of the function and make it available everywhere:
if (!function_exists('set_magic_quotes_runtime')) {
function set_magic_quotes_runtime($new_setting) {
return true;
}
}

You are using PHP version 7.x.x, at which set_magic_quotes_runtime() was removed.
This function was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0.

Related

PHP Catchable fatal error: Argument 3 passed to [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Catchable fatal error: Argument 3 passed to Account::updateUser() must
be an instance of , string given, called in
/Applications/XAMPP/xamppfiles/htdocs/myPage/beta/Includes/includes.php
on line 27 and defined in
/Applications/XAMPP/xamppfiles/htdocs/myPage/beta/classes/Account.php
on line 214
Line 27:
$Account->updateUser($_SESSION["username"], $_POST["password_check"], $_POST["pw1"], $_POST["pw2"]);
Line 214:
public function updateUser($session, $password_check, $pw, $pw2){
How may I fix this? I've tried to rewrite the code multiple times, and tried to change everything on line 214 and below. Also tried to change some of line 27, cannot find the problem and have googled for a long time.
I think there is an invisible character (something like an unbreakable space, or some other invisible utf8 char) in your function declaration and php think it's type hint. You could delete the line and rewrite it. I thnik the probleme is here because must be an instance of , means php want a variable of type "".
Delete and rewrite the function declaration (no copy/paste)

mysql_connect() fatal error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have a problem, when I write my welcome.php I need to use mysql_connect() but when I run it, an error appears:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/u781677053/public_html/cas/welcome.php:4 Stack trace: #0 {main} thrown in /home/u781677053/public_html/cas/welcome.php on line 4
I'm using a web called Hostinger.es, not apache, or any stuff
The code:
mysql_connect("localhost","u781677053_lo","987654") or die();
mysql_select_db("u781677053_po") or die();
mysql_* is now deprecated . Use mysqli_* OR PDO
You can do it like below in mysqli_*:-
$connect = mysqli_connect("localhost","u781677053_lo","987654","u781677053_po") or die(mysqli_connect_error());

Fatal error: Function name must be a string whilst it shouldn't [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have stumbled over the following error in PHP:
"Fatal error: Function name must be a string in
F:\Applications\xampp\htdocs\BTB_Sandbox\uploads.php on line 15"
and I don't know what the real problem is. Here is line 15 that the error is pointing at:
$error = $_FILES(['file_upload']['error']);
I hope you could help me, because I am kind of stuck now.
You are using $_FILES as a function because of ().
That way, PHP tries to call a function named as var $_FILES value, but this value it not a string (that's the error reported), it is an array.
Obviously, in your code line you are failing to use $_FILES, the right way is:
$error = $_FILES['file_upload']['error'];

Weird PHP "Fatal error: Cannot redeclare" Error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
My script is returning the following error...
Fatal error: Cannot redeclare connecttodatabase() (previously declared in /var/www/api/connecttodatabase.php:4) in /var/www/api/connecttodatabase.php on line 6
And the following is the connecttodatabase.php file...
<?php
function connecttodatabase()
{
$con = #mysqli_connect("localhost", "name", "password", "database");
return $con;
}
?>
I don't really understand this error because line 6 is just the closed curly bracket (})
I think the error means that it thinks I declared the function connecttodatabase() in to different spots but clearly I didn't.
As others have said in the comments, this is most likely because you have included connecttodatabase.php twice in your code, and you are certainly defining the function twice. Don't get hung up why it's line 6; line 2 would be more helpful, but line 6 is where the function definition ends, and so arguably is when the function is defined. You could have a "one a day" whole year calendar on the idiosyncrasies of PHP and have enough left over for a sequel. As others have also hinted, some basic debugging would confirm whether you are including the file more than once and also from where.
Make sure that your code uses include_once or require_once.

Getting Multiple Errors In PHP code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am trying to use this file manager called "Php Win2K File Manager"
But I am receiving these errors below
Deprecated: Call-time pass-by-reference has been deprecated in C:\xampp\htdocs\test\explorer.php on line 166
Deprecated: Call-time pass-by-reference has been deprecated in C:\xampp\htdocs\test\explorer.php on line 214
Warning: opendir(c:/inetpub/wwwroot/,c:/inetpub/wwwroot/) [function.opendir]: The system cannot find the path specified. (code: 3) in C:\xampp\htdocs\test\explorer.php on line 91
Warning: opendir(c:/inetpub/wwwroot/) [function.opendir]: failed to open dir: No such file or directory in C:\xampp\htdocs\test\explorer.php on line 91
Why is this? Is it because Im running this on a Linux Server instead of Win2K?
My page
Call-time pass-by-reference means that a variable is being passed into a function using the & operator in front of it. e.g. (someFunction(&$var);).
PHP 5.4 deprecated call-time pass-by-reference which means you cannot pass a variable by reference in the function call, the correct way is to define the function so the variable is always passed by reference. The function definition for the above call would look like:
function someFunction(&$iAmByReference) {
$iAmByReference = 42;
}
When you call it, you don't need to precede the variable with the &, the call just looks like:
$x = 32;
someFunction($x);
echo $x; // 42
You will have to modify the code so that the function definitions declare the variable as a reference variable, and remove the & from any function calls.
You say you are running on Linux, but given the PHP error messages it appears you are still on Windows. PHP says your script is C:\xampp\htdocs\test\explorer.php which is a Windows path.
Most likely $_GET['dir'] is incorrect, or the script is determining paths wrong. Not sure what's going on there, I'd have to see how you were accessing the script. In the first case, it looks like its trying to open a path that is actually 2 paths separated by commas.

Categories