Post by remington.stone » Fri Feb 15, 2019 5:28 am

Hey all, i'm wokring on building a custom module and looks like i may have some permission issues and haven't been able to figure this one out. After i've installed the module, i'm running into this error when i'm in the extensions tab and click on the module's in the dropdown.

The error i see is: warning, require(file) failed to open stream: permission denied. that alerts me.

I looked in my apache logs and found:
PHP Fatal error: require(): Failed opening required '/var/www/html/opencart/admin/language/en-gb/extension/module/name.php' (include_path='.:/usr/share/php') in /var/www/html/opencart/system/library/language.php on line 49, referer: path/opencart/admin/index.php?route=extension/extension&token=token


it all appears to be happening in /var/www/html/opencart/system/library/language.php on line 49 which is part of the load function


public function load($filename, &$data = array()) {
$_ = array();

$file = DIR_LANGUAGE . 'english/' . $filename . '.php';

// Compatibility code for old extension folders
$old_file = DIR_LANGUAGE . 'english/' . str_replace('extension/', '', $filename) . '.php';

if (is_file($file)) {
require($file);
} elseif (is_file($old_file)) {
require($old_file);
}

$file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';

// Compatibility code for old extension folders
$old_file = DIR_LANGUAGE . $this->default . '/' . str_replace('extension/', '', $filename) . '.php';

if (is_file($file)) {
require($file) // here is the error




My module folder structure is:

upload
├── admin
│   ├── controller
│   │   └── module
│   │   └── extension
│   │   └── name.php
│   ├── language
│   │   └── en-gb
│   │   └── module
│   │   └── extension
│   │   └── name.php
│   ├── model
│   │   └── module
│   │   └── extension
│   │   └── name.php
│   └── view
│   └── template
│   └── module
│   └── extension
│   └── name.tpl
└── catalog
├── controller
│   └── module
│   └── extension
│   └── name.php
└── model
└── module
└── extension
└── name.php


Note on the above, i've experimented with en-gb and english as the language. when it's en-gb i get the permission error, when i use english i don't get any errors but the module doesn't show in the list in extensions > modules


Posts

Joined
Fri Feb 15, 2019 2:35 am

Post by straightlight » Fri Feb 15, 2019 10:58 pm

PHP Fatal error: require(): Failed opening required '/var/www/html/opencart/admin/language/en-gb/extension/module/name.php' (include_path='.:/usr/share/php') in
Either a missing, invalid or corrupted language file.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Amazon [Bot] and 8 guests