• Что за fopen через HTTPS у Вас в коде? Почему нельзя просто прочитать через тот же file_get_content или просто с диска? Зачем так усложнять себе жизнь?

    <b>Warning</b>:  fopen(https://mysite.ru/wp-content/plugins/russian-post-and-ems-for-woocommerce/inc/post-calc/postcalc_light_post_indexes.txt): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
     in <b>/home/i/mysite.ru/public_html/wp-content/plugins/russian-post-and-ems-for-woocommerce/inc/class-rpaefw-shipping-method.php</b> on line <b>537</b><br />
    <br />
    <b>Warning</b>:  fopen(https://mysite.ru/wp-content/plugins/russian-post-and-ems-for-woocommerce/inc/post-calc/postcalc_light_post_indexes.txt): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
     in <b>/home/i/mysite.ru/public_html/wp-content/plugins/russian-post-and-ems-for-woocommerce/inc/class-rpaefw-shipping-method.php</b> on line <b>537</b><br />
    • This topic was modified 4 years, 9 months ago by Leonid.
Viewing 1 replies (of 1 total)
  • Thread Starter Leonid

    (@tushov)

    я немного поправил Ваш код и всё заработало:

    		//$src_txt = plugin_dir_url( __FILE__ ) . 'post-calc/' . $src_txt;
    		$src_txt = plugin_dir_path( __FILE__ ) . 'post-calc/' . $src_txt;
    		$src_idx = plugin_dir_url( __FILE__ ) . 'post-calc/' . $src_idx;
    		$search  = mb_convert_case( $search, MB_CASE_LOWER, $config_cs );
    
    		// deep looking if file does not exists or no search is provided
    		if ( ! file_exists( $src_idx ) || $search == '' ) {
    			if ( is_ssl() ) {
    				//$fp = fopen( $src_txt, 'r', false, $context );
    				$fp = fopen( $src_txt, 'r' );
    			} else {
    				$fp = fopen( $src_txt, 'r' );
    			}
Viewing 1 replies (of 1 total)
  • The topic ‘fopen postcalc_light_post_indexes.txt : failed to open stream: HTTP request fail’ is closed to new replies.