cancel
Showing results for 
Search instead for 
Did you mean: 

API failed to open stream when it was in /local

SOLVED

API failed to open stream when it was in /local

Hey there,

 

I created an strange issue, which I can't figure out by myself.

 

I "overrode" an Api.php file (doesn't matter which one), e.g. /Mage/Customer/Model/Customer/Api.php, by putting it in the /code/local/ directory. That happened for testing purposes. Now that finished testing i deleted the file /code/local/Mage/Customer/Model/Customer/Api.php, because it wasn't needed in the changed version. I wanted to switch back to the original file, existing in /code/core/Mage/...

 

What happens now is, if I make an api-call i sometimes(!) get that error:

2016-02-10T08:26:07+00:00 DEBUG (7): include(/www/app/code/local/Mage/Customer/Model/Customer/Api.php): failed to open stream: No such file or directory/www/lib/Varien/Autoload.php
2016-02-10T08:26:07+00:00 DEBUG (7): include(): Failed opening 'Mage/Customer/Model/Customer/Api.php' for inclusion (include_path='/www/app/code/local:/www/app/code/community:/www/app/code/core:/www/lib:.:/usr/share/php:/usr/share/pear')/www/lib/Varien/Autoload.php

Thanks for your help.

 

P.S.: I could do a work around by letting the Api.php file exist in the /local/ directory, but i don't think that's what it meant to be.

 

3 REPLIES

Re: API failed to open stream when it was in /local

Flush cache?

Tanel Raja

Re: API failed to open stream when it was in /local

I tried that, which had no effect.

 

Now that I tried flushing the cache and restarting the webserver it works.

I don't know why i had to restart the webserver - but it worked!

 

Thank you.

Re: API failed to open stream when it was in /local

Sometimes you need to restart PHP-FPM. I've spent frustrated hours wondering why my changes don't manifest themselves only to find out that FPM didn't bother to reload my stuff.

Tanel Raja