I need to install a module in x-cart 4.4.4 (https://help.x-cart.com/index.php?title=X-Cart:X-PDF_Invoices).
X-cart is in the root directory, but installed modules are in root/modules
. The installation instructions suggest unpacking and moving all module directories into the root directory for installation.
This is something I cannot do - the contents of the module includes files and folders with the same names as those found in the root directory.
Instead I have unpacked the contents into a subdirectory of root/modules/
. Within the installation script I have changed the cwd
to root whch fixes files not found errors, but when it gets to the x-cart install.php
it breaks and I get an error (no error showing in nginx logs).
For example:
//change cwd to root
chdir(str_replace('modules/X_PDF', '', __DIR__));
if (!@include('./top.inc.php')) {
die('X-Cart not found in '.dirname(__FILE__));
}
if (!@include('./init.php')) {
die('init.php not found. Please, unpack ' . $module_definition['name'] . ' module in <xcart> directory');
}
Here we require the x-cart install script. File path is correct and script is being called.
require_once $xcart_dir . '/include/install.php';