main.php requires 2 files:
require './functions/fileA.php';
require './functions/fileB.php';
fileA.pgp as a function
function doecho($url){echo $url}
In fileB.php, I have a function that calls the doecho function
function withinBfunction($url){doecho($url);}
But I get this error,
Uncaught Error: Call to undefined function curl().
However, if, in fileB.php I call the doecho function outside any function, it works. It seems that the functions in fileB.php cannot access the functions on fileA.php
I took a look at this post (PHP Fatal error: Call to undefined function when function is defined) but the difference is that I am not using classes. Any ideas how I could solve this?
Oh, and, yes, I have turned on the php error log with (error_reporting(E_ALL & ~E_NOTICE & E_STRICT & ~E_DEPRECATED) and all I get is that "call to undefined function".
includedoes not die if the file can't be loaded. userequireto make sure the file is loaded correctly.fileA.phpis included? Maybe the interpreter cannot find it and the warning it triggers is suppressed by your configuration. Userequireinstead.include './functions/fileB.php';. Tryinclude '../functions/fileB.php';