php Woocommerce不读取地址

ev7lccsx  于 2022-12-17  发布在  PHP
关注(0)|答案(1)|浏览(142)

我开始在我的woocommerce结帐页面上得到一个错误。我添加了所有必要的数据(姓名、地址、移动的电话、电子邮件...),当我单击完成时,网站并不采用我的地址,就好像它不存在一样。我激活了调试模式,它返回了两个错误。这些错误中是否有与我的问题有关的错误?我将在下面留下这些错误,以及相应的代码行。并提前感谢任何试图帮助我的人。
错误1:

PHP Warning:  mysqli::__construct(): (HY000/1045): Access denied for user 'my_user'@'localhost' (using password: YES) in /home/aplako/contas/plako/combperelhal.com/www/wp-content/themes/divi-business-pro/functions.php on line 7

php函数的第7行(第一行):

$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

错误二:

PHP Warning:  session_start(): Cannot start session when headers already sent in /home/aplako/contas/plako/combperelhal.com/www/wp-content/plugins/sibs-woocommerce/class-sibs-payment-gateway.php on line 236

第236行是这个函数的最后一行,但我认为最好把整个函数留在这里。

function sibs_init_payment_gateway() {

    /**
     * Loads the Sibs language translation strings
     */
    load_plugin_textdomain( 'wc-sibs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
        add_action( 'admin_notices', 'sibs_get_notice_woocommerce_activation' );
        return;
    } else {
        add_action( 'admin_notices', 'validate_sibs_term' );
    }

    include_once dirname( __FILE__ ) . '/includes/class-general-functions.php';
    include_once dirname( __FILE__ ) . '/includes/class-general-models.php';
    include_once dirname( __FILE__ ) . '/includes/admin/class-sibs-general-settings.php';
    include_once dirname( __FILE__ ) . '/includes/admin/class-sibs-backend-settings.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibspaymentcore.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibserrorhandler.php';
    include_once dirname( __FILE__ ) . '/includes/core/class-sibsversiontracker.php';

    if ( ! class_exists( 'Sibs_Payment_Gateway' ) ) {

        
        class Sibs_Payment_Gateway extends WC_Payment_Gateway {
            
            protected $payment_id;
        
            protected $payment_type;
        
            protected $payment_brand;
            
            protected $language;
            
            protected $payment_group;
            
            protected $payment_display = 'form';
            
            private static $saved_meta_boxes = false;
            
            private static $added_meta_boxes = false;
            
            private static $added_payment_method = false;
            
            private static $updated_meta_boxes = false;
            
            protected $wc_order;

            
            public function __construct() {
                $this->payment_id    = $this->id;
                $payment_gateway     = Sibs_General_Functions::sibs_get_payment_gateway_variable( $this->payment_id );
                $this->payment_type  = $payment_gateway['payment_type'];
                $this->payment_brand = $payment_gateway['payment_brand'];
                $this->payment_group = $payment_gateway['payment_group'];
                $this->language      = $payment_gateway['language'];
                $this->plugins_url   = Sibs_General_Functions::sibs_get_plugin_url();

                $this->form_fields  = Sibs_Backend_Settings::sibs_create_backend_payment_settings( $this->payment_id );
                $this->method_title = Sibs_Backend_Settings::sibs_backend_payment_title( $this->payment_id );
                $this->method_description = Sibs_Backend_Settings::sibs_backend_payment_desc( $this->payment_id );
                
                $this->init_settings();

                // Save admin configuration from woocomerce checkout tab.
                add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
                // Frontend hook.
                add_action( 'woocommerce_receipt_' . $this->payment_id, array( &$this, 'sibs_receipt_page' ) );

                add_action( 'woocommerce_thankyou_' . $this->payment_id, array( &$this, 'thankyou_page' ) );
                // Backend hook.
                add_action( 'woocommerce_process_shop_order_meta', array( &$this, 'sibs_save_order_meta' ) );
                add_action( 'woocommerce_admin_order_data_after_order_details', array( &$this, 'sibs_update_order_status' ) );
                add_action( 'woocommerce_admin_order_data_after_billing_address', array( &$this, 'add_payment_method' ) );
                add_action( 'woocommerce_admin_order_data_after_shipping_address', array( &$this, 'sibs_add_additional_information' ) );

                // Added for Capture
                
                /**
                 * hook to add the ajax callback
                 */
                global $action_addded_my_function_to_add_the_product;
                if (!$action_addded_my_function_to_add_the_product) {
                    add_action( 'wp_ajax_add_my_product_to_order', array( &$this,'sibs_my_function_to_add_the_product') );
                    $action_addded_my_function_to_add_the_product = true;
                }

                //custom email  
                add_action( 'woocommerce_email_order_meta', array( &$this, 'sibs_add_multibanco_data_to_order_email'), 10, 4 );

                // Add a custom metabox only for shop_order post type (order edit pages)
                add_action( 'add_meta_boxes', array( &$this, 'sibs_add_meta_boxesws' ) );
                
                //WebHook
                add_action( 'rest_api_init', function(){
                    register_rest_route(
                        'sibs-api/v1',
                        '/callback_hook',
                        array(
                            'methods'  => 'POST',
                            'permission_callback' => '__return_true',
                            'callback' => array( &$this,'callback_hook'),
                            )
                    );
                } );

                // Enable woocommerce refund for {payment gateway}.
                $this->supports = array( 'refunds' );

                if ( isset( WC()->session->sibs_thankyou_page ) ) {
                    unset( WC()->session->sibs_thankyou_page );
                }
                if ( isset( WC()->session->pmtRef ) ) {
                    unset( WC()->session->pmtRef );
                }

                if ( isset( WC()->session->ptmntEntty ) ) {
                    unset( WC()->session->ptmntEntty );
                }

                if ( isset( WC()->session->refIntlDtTm ) ) {
                    unset( WC()->session->refIntlDtTm );
                }

                if ( isset( WC()->session->RefLmtDtTm ) ) {
                    unset( WC()->session->RefLmtDtTm );
                }

                if ( isset( WC()->session->sibs_receipt_page ) ) {
                    unset( WC()->session->sibs_receipt_page );
                }
                if ( isset( WC()->session->sibs_confirmation_page ) ) {
                    unset( WC()->session->sibs_confirmation_page );
                }
                if ( !session_id()  && empty(session_id())) {
                    session_start( [
                        'read_and_close' => true,
                    ] );
                }
            }
gr8qqesn

gr8qqesn1#

Access denied for user 'my_user'@'localhost' (using password: YES)
第一个错误表示PHP脚本无法访问MySQL数据库。
是否已验证数据库的用户/密码/主机名是否正确?

相关问题