0

I need to integrate this PHP library on my WordPress site. I read that you have to create a plugin or integrate it into the child theme. So I created a plugin and integrated the PHP library in the plugin folder.

https://ibb.co/vXfJjLj

Here is my plugin

    <?php 
/*
Plugin Name: igosen api boxtal
Plugin URI: 
Description: Relier marketplace à boxtal
Author: Serge Astrakhan
Version: 1.0
Author URI: https://igosen.fr/
*/

require_once ('/config/autoload.php');
require_once ('/config/config.php');

The require_once request causes a fatal error when activating the plugin. Can you help me (documentation or example) to be able to correctly load the different elements. Thank you

1 Answer 1

1

The / path will try to require the file from your server's root directory. Instead, try something like:

require_once( plugin_dir_path( __FILE__ ) . '/config/autoload.php' );
require_once( plugin_dir_path( __FILE__ ) . 'config/config.php' );

Reference

2
  • 1
    Thank you I succeeded. Oct 13, 2021 at 20:46
  • If this is the correct answer, please mark it Accepted so that it might help others having a similar problem.
    – Pat J
    Oct 13, 2021 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.