Home Wordpress functionality plugin how to require file elsewhere on server?
Reply: 0

Wordpress functionality plugin how to require file elsewhere on server?

user1031
1#
user1031 Published in May 23, 2018, 8:11 pm

I need to require_once() a file in my Wordpress functionality plugin which resides at home/me/vendor/ on the server. Wordpress of course is in www/html.

Can someone direct me on how to define the path to the required file? Nothing I try seems to work.

<?php
echo "file runs";
// This file is generated by Composer
require_once 'vendor/autoload.php';
echo “file runs”;
$client   = new QuickEmailVerification\Client('api key');
$quickemailverification  = $client->quickemailverification();

try {
$response = $quickemailverification->verify("don2@inklines.art");
}
catch (Exception $e) {
echo "Code: " . $e->getCode() . " Message: " . $e->getMessage();
}

echo "<pre>"; 
print_r($response); 
echo "/<pre>"; 

?>

The first echo displays as expected (just a test). The second one does not so, for starters, I think the file can’t locate the required() file.

I just need direction on getting the file found. Any help is appreciated.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330956 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO