0

I receive the following errors in system.log:

2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Adapter.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Adapter.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Transaction.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Transaction.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Card.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Card.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Client.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Client.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94

I tested if it's looking the correct directory and it does.

This is first part of the php code of Client.php:

<?php
namespace Paylike;
include_once( 'Adapter.php' );
include_once( 'Transaction.php' );
include_once( 'Card.php' );

Anyone knows why it says failed to open stream: no such file or directory? Adapter.php, Transaction.php and Card.php are in the same directory as Client.php. Also tested replacing ( ' with __DIR__ . '/

3
  • Have you checked the permission of the files?<br> Maybe it's only a permission issue. Commented Jan 25, 2018 at 12:14
  • 1
    Is this class inside a Magento module? or /lib folder? or what? :) Commented Jan 25, 2018 at 12:22
  • You can check github.com/paylike/plugin-magento-1.9 for the module.
    – Sebastiaan
    Commented Jan 25, 2018 at 12:50

1 Answer 1

0

The best way is to rewrite this code (classes in Model/api dir) as Magento module models. Then you can access them using:

$model = Mage::getModel('namespace/module_model');

Otherwise you can put them into /lib/ModuleName catalog, call them like that:

new ModuleName_Client();

and then probably:

include_once( 'Adapter.php' );

won't be no longer neccessary - Magento (Zend) autoloader should find them.

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.