M
M
Michael2015-10-16 14:59:44
PHP
Michael, 2015-10-16 14:59:44

Why doesn't php see functions?

Simplified index file structure

<?
include('include/bd.php');
/*
процесс получени из бд и так далее
*/
$param = 'какой либо файл';
include($param); // в этом файле
?>

I have several functions in the bd file. The
question is that sometimes, I emphasize that sometimes a function is not defined in any file. That is, a user-defined function does not exist, how can this even happen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2015-10-16
@mix_gorbachev

Try replacing include with require. And everywhere specify absolute paths to files, instead of relative ones.
This is not a bug on the server, since it works fine most of the time, it's purely a programmer's fault. You have to look at the code to know for sure.
Perhaps there is a problem with the namespace, although if you only have functions, then it’s unlikely.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question