skip to Main Content

i am doing in wordpress 5.3 the pulgin for woocommerce is showing this msgs

Warning: require_once(/home/sitename/public_html/1): failed to open
stream: Success in
/home/sitename/public_html/wp-content/plugins/learnpress-woo-payment/incs/load.php
on line 80

Fatal error: require_once(): Failed opening required ‘1’
(include_path=’.:/opt/alt/php72/usr/share/pear’) in
/home/sitename/public_html/wp-content/plugins/learnpress-woo-payment/incs/load.php
on line 80

above occurs on live server whereas same plugin and everything works very well in localhost

i m working on https:// secure url

please help

2

Answers


  1. Chosen as BEST ANSWER

    I got the solution

    Websites behind load balancers or reverse proxies that support HTTP_X_FORWARDED_PROTO can be fixed by adding the following code to the wp-config.php file, above the require_once call:

    if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { $_SERVER['HTTPS'] = 'on'; }

    Here the link


  2. Add the following to your wp-config.php file (in your root directory):

    define("LP_ADDON_WOO_PAYMENT_PATH", "/home/sitename/public_html/wp-content/plugins/learnpress-woo-payment");
    

    This is a long shot, but it should at least give us a different error. It sounds like you migrated from localhost to a production server, but either some configurations are now incorrect, or some files were copied over incorrectly.

    The error message tells us that your learnpress-woo-payment plugin is trying to load a file called “1”, and other details of the error indicate that the plugin was not given an exact path. I assume that “1” is actually a boolean, so the plugin is somehow ending up with a TRUE in place of a file path… so, we take a look at the code for the plugin:

    if ( $this->is_enabled() && $this->woo_checkout_enabled() ) {
            // WooCommerce checkout
            $checkout = require_once LP_ADDON_WOO_PAYMENT_PATH . '/incs/class-lp-wc-checkout.php';
            if ( file_exists( $checkout ) ) {
                    require_once $checkout;
            }
    }
    

    …this doesn’t quite match what I expected to see (line 80 is the comment), but it does seem like: if the first require_once fails in a way that returns SUCCESS (it does due to an irregular bug with PHP) then $checkout becomes TRUE… which apparently exists, so we attempt to include it again! Not great code…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search