In a downloaded module there is a specific call Mage::getModel('module/statistic_collection'), this gives me the failed to open stream: No such file or directory error with the path Namespace/Module/Model/Statistic/Collection.php but it exists in Namespace/Module/Model/Mysql4/Statistic/Collection.php.
So how can I tell magento that they need to add the Mysql4 folder ?
You have two options:
Mage::getResourceModel('module/statistics_collection')
or
Mage::getModel('module/statistics')->getCollection()
Related
I just run
composer update
but I got this
Failed loading ./opcache.so: ./opcache.so: cannot open shared object file: No such file or directory
PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './calendar.so' - ./calendar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './ctype.so' - ./ctype.so: cannot open shared object file: No such file or directory in Unknown on line 0
... so on
I run php -i and got this
Loaded Configuration File => /etc/php/7.0/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.0/cli/conf.d
Additional .ini files parsed => /etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
... so on
How do I fix it?
Thanks in Advance.
Your php can not find the dlls. To solve it:
Run php -i and find your php.ini location under Loaded Configuration File key.
Search for the dll files php unable to load and find their full path
Update the extension key in your php.ini to the full dll path
for example:
extension=<path>/php_pdo_firebird.dll
extension=<path>/php_pdo_mysql.dll'
extension=<path>/php_pdo_pgsql.dll:
composer use php.ini in /etc/php/7.0/cli/php.ini looks like you uncoment extension_dir
just comment, and reload apache and you done it.
I have a PHP file located at holiday/app/Console/Commands/myCommand.php with:
namespace Holiday\Console\Commands;
$bob = file_get_contents('Storage/data/BE.json');
and it works.
However in holiday/app/Http/Controllers/holidayController.php I have:
namespace Holiday\Http\Controllers;
$bob = file_get_contents('Storage/data/BE.json');
but I get
file_get_contents(Holiday/Storage/data/BE.json): failed to open stream:
No such file or directory
Does anybody know why this is?
You should always use helpers to get correct path. Here, use storage_path() helper. For instance:
file_get_contents(storage_path('data/BE.json'))
This will create correct path to the laravel_project/storage/data/BE.json file.
Using Magento in admin, when I click the configuration tab, I get the following error:
"Fatal error: Class 'Magestore_Magenotification_Helper_Data' not found in."
Does anyone know why this would happen and how to fix it?
Normally this error occurs only if your Helper data is missing. Check your Data.php file at your_code_pool/Magestore/Magenotification/Helper. If that file does not exist, check your downloaded module or contact #Magestore if you install this module by Magento connect or create Data.php file with following code: (This may fix the above error only)
<?php
class Magestore_Magenotification_Helper_Data extends Mage_Core_Helper_Abstract
{
}
You need to disable the module. Go to app/etc/modules in your codebase and open file Magestore_Magenotification.xml and change the <active> node to false. Clear magento cache and reload the page.
Please check the config.xml of the module and also verify the namespace of the module which must match with the module name space under app/etc/modulename_namespace.xml.
I had this error because I was on PHP 7.1 and not 5.6
I am using smarty 3 .its not working in subfolder.
Folder Structure
WWW
->admin
->cache
->configs
->libs
->plugins
->templates
->templates_c
index.php
In index.php [Root Folder] it working correctly.
But in admin/index.php it not working i am getting error.
here is my code
require_once('../libs/Smarty.class.php');
$smarty = new Smarty;
$smarty->display('index.tpl');
Error :
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\wamp\www\libs\sysplugins\smarty_internal_templatebase.php on line 127
After reading some stackoverflow answer i added $smarty->template_dir = "/templates"; but still i am getting the same error.
Please help me thank you
The content of $smarty->template_dir is relative to the actual directory. (if it is a relative directory.)
It means if you call a admin/index.php then it searches the templates in the admin/templates directory by default. (without adding anything.)
So in the admin directory you should use:
$smarty->template_dir = "../templates";
or an absolute directory.
Otherwise I think you should read this page:
http://www.smarty.net/docs/en/variable.template.dir.tpl
Especially this sections:
It is not recommended to put this directory under the web server document root.
I'm trying to add a new email template via adminhtml -> system -> transactional email -> new template.
However, when I go to that page, the drop down list for the default template has no option in it and there is nothing else on that page.
I checked on /var/log/system.log and the found the following lines:
Warning: include(Mage/Email/Helper/Data.php) [function.include]: failed to open stream:
No such file or directory in
/home/jille/public_html/lib/Varien/Autoload.php on line 93
Warning: include() [function.include]:
Failed opening 'Mage/Email/Helper/Data.php' for inclusion
(include_path='/home/jille/public_html/app/code/local:/home/jille/public_html/app/code/community:/home/jille/public_html/app/code/core:/home/jille/public_html/lib:.:/usr/lib/php:/usr/local/lib/php')
in /home/jille/public_html/lib/Varien/Autoload.php on line 93
I went into the source and could not find any reference to this file. Any idea on how to fix this issue?
Thank you very much
If helper is used or in translate xml node you refer to module then magento will search for module/Helper/Data.php file.
You just create a file data.php
class Mage_Modulename_Helper_Data extends Mage_Core_Helper_Abstract
{
}
This will fix your error.