i'm having a 500 internal server problem. http://www.bunchmag.com/
500 internal server error Fatal error: Cannot redeclare frm_dl
20130329T141539: www.bunchmag.com/index.php PHP Fatal error: Cannot
redeclare frm_dl() (previously declared in
/hermes/web09/aksjhfks/moo.bunchmagazinecom/bunch/index.php(1) :
eval()'d code:1) in
/hermes/web09/skjfljf/moo.bunchmagazinecom/bunch/wp-config.php(1) :
eval()'d code on line 10
my hosting tech support is working on it but any help would be greatly appreciated!
Locate where the function is being declared and wrap it in an if statement to ensure the function is not already declared.
if( !function_exists( "frm_dl" ) ){
function frm_dl(..){
...
}
}
this should solve the issue if its the same file being included twice.
alternatively, search for multiple files declaring the function and wrap each one in the conditional statement, or change on of the function names (if possible)
Related
So i am working on some code and have come across this error and its starting to bug me a little as i cant find out what is wrong
i have 2 files main.php and that includes functions.php now in the main file i have the following code
<?php
include "functions.php";
$NAME = GET_USER_NAME();
?>
That is all thats in the main file now in the functions file i have the following code
<?php
function GET_USER_NAME() {
return 'bob';
}
function GET_USER_AGE() {
return '5';
}
?>
now when i try and open main in my browser i get the error
Fatal error: Uncaught Error: Call to undefined function GET_USER_NAME() in /var/www/html/main.php:3 Stack trace: #0 {main} thrown in /var/www/html/main.php on line 3
i know the file is being included properly as i can run the function
GET_USER_AGE();
from the main file and it returns 5
The only possible solutions to your problem are :
A typo in the function called in the main, which is not the exact same as in your included file (case sensitivity ?)
The include references a file which is not the one you want (but has one of the 2 desired functions)
And also yes, as #Markus-Zeller says, don't use method names like that, as stated here : https://www.php-fig.org/psr/psr-1/#1-overview
I'm working on a simple imageboard based by TinyBoard (xampp), when I try to post with image, website gives me error for some reason:
Fatal error: Cannot redeclare imagecreatefrombmp() in C:\xampp\htdocs\inc\image.php on line 584
image.php:
[1]https://pastebin.com/xqj2NAuX
(584 line = 77 line)
PHP 7.2, any help?
ANSWER:
Just change the function name to something else on line 1:
function imagecreatefrombmp2($filename)
(from user3647971)
Just change the function name to something else on line 1 :
function imagecreatefrombmp2($filename) {
the error warns you that a function named exactly like this has already been declared. It's a built-in php function: http://php.net/manual/en/function.imagecreatefrombmp.php
I am new to opencart, so please help me.
I am using opencart version 1.5.6, now whenever I edit and delete the product it shows me
Fatal error: Call to a member function productUpdateListen() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 78
and
Fatal error: Call to a member function deleteProduct() on a non-object in /home/crazepur/public_html/admin/controller/catalog/product.php on line 133 respectively.
Although it edit and delete the product.
Please help me how to fix it.
Code in Line 78 $this->openbay->productUpdateListen($this->request->get['product_id'], $this->request->post);
And code in line 133 $this->openbay->deleteProduct($product_id);
This means $this->openbay is not an object which contains function productUpdateListen() & deleteProduct(), probably it's NULL or false in some cases (nothing found) due to it's not accessible. Out of scope.
Try
var_dump($this->openbay);
Check the O/P
it's simple and the error-message says it all: your $this->openbay doesn't have those methods (productUpdateListen() and deleteProduct()) - most likely it isn't an object at all.
please debug your code since it's impossible to say what's going wrong wich so little information. to start, do a var_dump($this->openbay); right before the function-calls and check the output.
I am getting an error when I try to access my site (site on WordPress)
Fatal error: Call to undefined function themify_build_write_panels() in /home/ash/public_html/wp-content/themes/metro/theme- functions.php on line 931
My line 931 is =>
themify_build_write_panels( apply_filters(
'themify_theme_meta_boxes' ,
please help me!!
Thanks :)
This error is occurring because you did not define this function in functions.php
Check if you properly defined this function or not.
Find this function in your functions.php
function themify_build_write_panels(){
//statements
//statements
}
You are right you are new to WordPress but as a developer you should know programming and how functions are used in programming and also how to define them.
Error is transparent that you did not define your function.
I'm basically trying to include a php file on my index.php file for my usersystem. But I've ran into an error. This is the code I used:
<?php include("usersystem/index.php"); ?>
Error:
Fatal error: Cannot redeclare random() (previously declared in
/home/public_html/upload.php:2) in /homepublic_html/global.php on line
35
Upload.php: http://pastebin.com/YcJYF2hb
global.php on line 35 I have: }, part of the file is at http://pastebin.com/gMsiPa7Z
I don't understand what's going on?
You cannot declare two functions with the same name. Both the snippets included above contains a function named random defined. I suggest that you rename them to be more specific.