Call to undefined function mod_dir() - php

I am trying to host an app which is already written and i am unable to process beyond this point, I know this might be very little detail to solve this issue. But anyone has any idea what this function is? (mod_dir()). Am i missing a library.
<?php
global $dir;
echo 'a';
$dir = mod_dir();
?>
Actual error : Fatal error: Call to undefined function mod_dir() in /Users/****/Sites/test/index.php on line 10

Related

Fatal error: Uncaught Error: Call to undefined function that is not in a class

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

Call to a member function render_social_icons() on a non-object

i have received a Fatal error from logs its repeating same error.
I don,t understand what to do please help me out on this.
Eroor logs:
PHP Fatal error: Call to a member function render_social_icons() on a
non-object in content-single.php on line 190
Code :
<div class="fusion-sharing-box share-box">
<h4>
<?php echo __('Share This Story, Choose Your Platform!', 'Avada'); ?></h4>
<?php
echo $social_icons->render_social_icons( $sharingbox_soical_icon_options );
?>
Create an object of class then use it in cotent-single.php file.Before that you have to include file for that specific class.
$social_icons= new <Some class>;
$social_icons->render_social_icons( $sharingbox_soical_icon_options );
You have to share cotent-single.php that will give more idea.
$social_icons isn't what you're expecting it to be.
You're treating $social_icons as an object when you try to call the render_social_icons() method and it's generating an error because it isn't one.
Where are you defining $social_icons? Was the code copied/pasted from elsewhere? Without seeing more code it's difficult to help devise a solution beyond suggesting that you trace it back and find out where $social_icons is being defined.

PHP Fatal Error Call to Undefined. Stop it breaking page?

Please forgive me if this is a duplicate question. I have searched but cant come up with an answer.
I am getting a PHP fatal error: call to undefined in my Wordpress site.
I know why this is, I am calling a method in my template file that is defined in a plugin - if the plugin isnt installed, then the template throws the error.
Is there any way I can encapsulate this method so that if it fails, the fatal error doesnt stop the rest of the page loading?
Many thanks.
You can check if the function is defined before calling it.
<?php
if (function_exists('plugin_function')) {
plugin_function();
} else {
error_log('plugin is not activated');
die();
}
?>

Fatal error: Call to undefined function themify_build_write_panels()

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.

Getting PHP Fatal error

I am getting the following error: PHP Fatal error: Call to undefined function updateRecord()
I know that means that PHP is unable to locate the function I am calling.
I double checked the spelling of the function name and the include file at the top of the page, and both are correct. I am not sure why PHP isn't recognizing the function in the included file.
Here is the code:
include_once('../lib/updatesEngine_lib.php');//include the file with the function
The function call:
updateRecord($jobid);
In updatesEngine_lib.php:
function updateRecord($jobid){//Code//}
I'm at a loss for why this isn't working. Especially since there are other functions in the updateEngine_lib.php file that are structured similarly that are working.
HELP!
Check your spelling for the third time or until you get it work.
There is no magic.
If it says "Call to undefined function" - so it is.
BTW, what if you call this function from updatesEngine_lib.php - does it work?

Categories