Separate php page not working with php 8.1
-
Before upgrading to php 8.1, I had a working clean, separate php page with only php-code on my wordpress site.
Like this:
mydomainname/public_html/wp-content/showlist/showlist.phpThe code will no longer accept root paths like: PLUGIN-NAME_ROOT_PATH
This code will not work either: $rootPath = dirname(__FILE__)
The page execution stops, codes after this will not show.
As an example:<?php require_once( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' ); echo "Hello!"; ?>This will NOT load the autoload part and the text Hello! will NOT show when executing.
I also use Get methods on this particulary showlist.php page, that won’t work either.
like:
…. wp-content/showlist/showlist.php?Form=Portrait
and code is:
$get_code=$_GET['Form'] ?? '';If I put the require_once code on functions.php it will work.
Anyone have a good answer to this strange problem?
The topic ‘Separate php page not working with php 8.1’ is closed to new replies.