Forum

Thread tagged as: Error

Fatal error: Call to undefined function perch_content()


HEALTH CHECK PHP 5.4.45 version is okay, but a little out of date. Consider updating soon. MySQL 5.6.36-cll-lve is up to date Image processing available SUMMARY INFORMATION Perch: 2.8.32, PHP: 5.4.45, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32) App runtimes: <?php $apps_list = array( 'content', 'categories', ); PERCH_LOGINPATH: /perch PERCH_PATH: /home/(clientname)/public_html/perch PERCH_CORE: /home/(clientname)/public_html/perch/core PERCH_RESFILEPATH: /home/(clientname)/public_html/perch/resources Image manipulation: GD Imagick PHP limits: Max upload 32M, Max POST 48M, Memory: 64M, Total max file upload: 32M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes SCRIPT_NAME: /perch/core/settings/diagnostics/index.php REQUEST_URI: /perch/core/settings/diagnostics/ DOCUMENT_ROOT: /home/(clientname)/public_html HTTP_HOST: www.(clientname).co.nz

The client was fiddling with the homepage page options and has broken things in a way I can't fix.

She changed the location path from "index.php" to "Profile 3 pic", saved it, then an error came up so she changed it back to "index.php".

However at this point the homepage returned some kind of error (they didn't say what).

Then they got someone else to reactivate a backup homepage file that is front end only.

Now I can see that index.php ended up in a folder called "Profile 3 pic", so I made a copy and moved it back to the root folder, I had to rename it index-test.php so it wouldn't interfere with the backup homepage.

Index-test.php in the root folder returns this error:

Fatal error: Call to undefined function perch_content() in /home/maddesignnz/public_html/index-test.php on line 59

How do I get rid of this error? As far as I can see, everything is back where it was.

S Tasker

S Tasker 0 points

  • 3 years ago
<?php include(‘/perch/runtime.php’); ?>

Likely the perch runtime is missing.

must be the very first line on the page without so much as a space before it.

Check to see if the runtime.php is being referenced properly ... I can cause/replicate this error on my site by changing this (the correct code) include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); to something incorrect like include($_SERVER['DOCUMENT_ROOT'].'/wrong_dir/perch/runtime.php'); ... perhaps when things got moved around the runtime.php include got changed.

Sorry.... it may be

<?php include('perch/runtime.php'); ?>

On my phone today...

Robert Ketter said:

<?php include(‘/perch/runtime.php’); ?>

Likely the perch runtime is missing.

must be the very first line on the page without so much as a space before it.

you beat me to the punch as I was typing ...

<?php include('../perch/runtime.php'); ?>

has not been deleted from the top of the document.

I have tried to replace it with:

<?php include('/perch/runtime.php'); ?>

but this does not change the situation.

That's the thing about this issue - the document itself hasn't been messed with, just the path of it (according to what my client said she did, and also according to what I can see)

Ok now it works! I tried changing it to this:

<?php include('perch/runtime.php'); ?>

I guess the index page had been in a different location to where it is now.

Thank you!