I'm making a new php page and I get the error
Fatal error: Call to undefined function phpinclude_once() in /home8/nuventio/public_html/marketing/pb2/dashboard.php on line 1
I'm not sure why I'm getting this error, I've done previous pages the same way as this with no problems. This is the line in question:
<?php
include_once("../utils.php");
?>
After that it just goes into regular HTML code. It wor开发者_StackOverflow中文版ks fine without that line.
try making sure there is an enter between your <?php
and your include_once
It seems like you might have short tags, and it is interpreting it as:
<?
= Open Tag
phpinclude_once("../utils.php");
= Function call
So just put an extra line or something in there. You could even just add a few semicolons for the heck of it.
Perhaps your editing program is saving your PHP files using only carriage-return style newlines (\r or 0x0D)
Because, as far as I know*, the parser will only recognize linefeed-style newlines (\n or 0x0A)
*Someone please correct me if I'm wrong on this one.
EDIT
Could also be a transfer issue - I believe some FTP programs will do newline conversion and other OS-specific stuff.
Delete the entire line and retype it. If PHP is saying the undefined function is phpinclude_once
then something is very weird, it's almost like PHP isn't seeing the newline between <?php
and include_once
, interpreting it as <? phpinclude_once
I fixed my problem (actually fixed, not a workaround).
Previous files were files that I had created myself. The files I was working on that were giving me this error had been given to me by a mac user.
In Notepad++, I found where it lists EOL info and found out that they were encoded using Mac EOL format which, while it looked fine in Notepad++, was not working once I uploaded it to my server (a *nix environment). In Notepad++, I converted the EOL to Windows format (either that or UNIX format worked, but Mac format doesn't). This is under Edit -> EOL Conversion.
There may be something in the interpretation, try adding a space before include_once() function.
精彩评论