Support » Plugin: PHP Everywhere » Include php file not working on live page

  • Thanks for a great plugin! I have been using this PHP plugin in Elemetor to retrieve data from database.

    I have a lot of pages that I need to use same HTML & PHP code so have tried using the Include so information can easily be edited for all files.

    The problem is when I use the Include file I can see it works correctly in Elementor editor but when I view the live page it does not show at all.

    It works fine if I don’t use the Include.

    Any ideas what could be causing this issue?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alexander Fuchs

    (@alexander_fuchs)

    Hi td75d, are you sure the path in your include is correct? Stuff in Elementor might be executed in a different relative path. You could try to use an absolute path in yoyr include.

    I know this was 3 weeks ago but I am too starting to have issues where my includes file is not always working.

    Example….
    I have a special functions file called funktions.php and it is located in the root directory. I have been including this file within the PHP Everywhere section along with other PHP code on my pages and it works great.

    I then decided to add a widget to right column in each page, so added the PHP/HTML widget and included the functions file along with a bit more code just to create some stats. However the include file is not being picked up.

    Now I have not used include_once to include the functions file, just the normal include(“funktions.php”); in every page and also in the widget.

    I worked out that it was not being included in the widget as I just put an echo statement echo “FREDISHERE” so I could see how many times then statement would appear in the page hence the number of times the include file is read.

    Does PHP Everywhere not include files that may already of been loaded?
    And yes, I have tried include_once but still the widget is not pulling in the include file though the rest of the code in the widget that does not refer to the functions file works so I know the widget is working ok.
    also tried an absolute path as well.

    Any ideas? Been doing this for about 2 weeks now.

    Plugin Author Alexander Fuchs

    (@alexander_fuchs)

    Hi captzeanie2016, the plugin should include both. I will try to reproduce your problem in the next view days. Maybe there is a bug.

    Thanks Alexander.

    I have got around the issue by..
    Creating a duplicate functions file and saving with a different name so it will get to included twice. eg

    include(“funktions.php”); in the php everywhere page
    include(“funktions1.php”); in the php everywhere widget

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.