Function call undefined phpinclude_once ()

I create a new php page and get an error

Fatal error: call to undefined function phpinclude_once () in / home 8 / nuventio / public_html / marketing / pb2 / dashboard.php on line 1

I am not sure why I am getting this error, I made the previous pages the same as this without any problems. This is the line in question:

<?php include_once("../utils.php"); ?> 

After that, it just goes into regular HTML code. It works great without this line.

+4
source share
4 answers

I fixed my problem (actually fixed, not a workaround).

Previous files were files that I created myself. The files I was working on gave me this error that the Mac user gave me.

In Notepad ++, I found where it lists the EOL information and found out that they were encoded using the Mac EOL format, which, although it looked great in Notepad ++, did not work as soon as I downloaded it to my server (environment * nix). In Notepad ++, I converted EOL to Windows format (either UNIX format, but not on Mac format). This is under Edit → EOL Conversion.

+1
source

try to make sure that between your <?php and your include_once

It looks like you might have short tags, and it interprets it as:

<? = Open tag
phpinclude_once("../utils.php"); = function call

So just add an extra line or something there. You can even add multiple semicolons for this.

+8
source

Perhaps your editing program will save your PHP files using only carriage return newline characters (\ r or 0x0D)

Because, as far as I know *, the parser will only recognize lines of lines in the style of linefeed (\ n or 0x0A)

* Someone, please correct me if I am wrong in this matter.

EDIT

There may also be a transmission problem - I believe that some FTP programs will do newline conversion and other OS-specific things.

+6
source

Delete the entire line and retype it. If PHP says that the function is undefined phpinclude_once , then something is very strange, almost the same as PHP does not see a new line between <?php and include_once , interpreting it as <? phpinclude_once <? phpinclude_once

+1
source

Source: https://habr.com/ru/post/1310415/


All Articles