Forum

Thread tagged as: Problem, Error, Installation

PHP Fatal error: Call to undefined function perch_content()

Hi,

I've installed Perch 2.5 to a new project. There i've installed the forms_app too. Now, I can do, what I want - nothing works. Perch drops me an PHP Fatal Error:

PHP Fatal error: Call to undefined function perch_content()

I have just make a simple test on a php-file with the following perch-tag:

<?php perch_content('Intro'); ?>

Has someone an idea?

Many thanks Marco

Marco Niedermann

Marco Niedermann 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

That sounds like either your Perch runtime include is incorrect or you haven't uploaded all of the files.

I'm sure I've installed the perch runtime correctly and I've copied all the files directly from the zip (it's local on my machine).

But the apps.php ind the config-folder looked very strange to me:

<?php
    $apps_list = array(
        'content', 
    );

So, I've deleted the $apps_list and replaced it with

<?php
    include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php');
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

The apps.php format is new for Perch 2.5. It's correct. If you want to stick with the old format, that's fine too, but you'll need to be sure to include the Content app.

<?php
    include(PERCH_PATH.'/core/apps/content/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php');
?>

Ahhh, ok. I'm sorry for the confusion. I thought it would be a new way, but I could not find any documentation about it. So, if I write it the new way, I'll have to do it like this?

<?php
    $apps_list = array(
        'content',
         'perch_forms',
    );

Because it works now with the content, but the forms won't work. It just does not show any of the form-fields

Edit: There is still the <perch:form..> Tag in the rendered HTML file

Drew McLellan

Drew McLellan 2638 points
Perch Support

The Forms app isn't required to render a form. There must be something else going on. What does your template look like?

I'm sorry Drew! It's my fault - oh damn! I have to put the <perch:forms..> etc. in a template and NOT directly in the page. Sorry and many thanks for your support!

Does the new format of apps.php need to be updated (as Marco did) when installing an app? I'm moving 3 beta sites to the new release and I'm wondering whether or not to switch to the new apps.php format at the same time. One of the sites does have the forms app running.