• Resolved jbkeefer

    (@jbkeefer)


    Hello all,

    Everything generally worked fine with my wordpress installs in subfolders but I have been working with the JSON API and I have been making function calls not likely used before. At least that is all I can figure.

    After a series of errors and attempts to resolve by including the necessary resources I finally hit the wall with the final ABSPATH error:

    Warning: require(ABSPATHWPINC/option.php): failed to open stream: No such file or directory in /home/XXXXXX/public_html/XXXXXX.com/wp-includes/functions.php on line 8

    No resolution –
    The error prior to that was:

    Fatal error: Call to undefined function wp_parse_args() in /home/XXXXXX/public_html/XXXXXX.com/wp-includes/class-http.php on line 400

    resolved with – include(“wp-includes/functions.php”);

    Prior to that:

    Class ‘WP_Http’ not found in /home/XXXXXX/public_html/XXXXXX.com/wp-includes/http.php on line 26

    resolved with – include(“wp-includes/class-http.php”);

    prior to that:

    Call to undefined function wp_remote_post() in /home/XXXXXX/public_html/XXXXXX.com/testput.php on line 11

    resolved with – include(“wp-includes/http.php”);

    So as you can see I was just hacking through it and it pretty clear there is something wrong with the PATH for the resources. How this hasn’t shown up before is a mystery, but here I am seeking some advice.

    Could the fact this is installed in sub directory be the cause of these issues? I am able to pull data no problem, but can not POST. FYI i am not POSTing to WP posts or pages but into a database within WP.

    Test Script:

    <?php
    
    	include("wp-includes/functions.php");
    	include("wp-includes/class-http.php");
    	include("wp-includes/http.php");
    
    	$url = "www.XXXXXX.com/wp-json/frm/entries";
    
    	$response = wp_remote_post( $url, array(
    	'method' => 'POST',
    	'timeout' => 45,
    	'redirection' => 5,
    	'httpversion' => '1.0',
    	'blocking' => true,
    	'headers' => array('Authorization' => 'Basic ' . base64_encode( $api_key .':XXXXXX' )),
    	'body' => json_encode(array( 'XXX' => 'Test',))
        )
    );
    echo $response
    ?>

    Thank you for your consideration.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Install in subfolder and subdomain error’ is closed to new replies.