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.CommentedOct 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
      CommentedOct 13, 2021 at 21:18

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.