Coder Social home page Coder Social logo

Autoloader not working? about selfoss HOT 5 CLOSED

fossar avatar fossar commented on June 6, 2024
Autoloader not working?

from selfoss.

Comments (5)

aurora avatar aurora commented on June 6, 2024

Puh ... strange things going on here ... i managed to track this down to a strange issue with "glob" in environments, where "open_basedir" is set. apparently 'glob' returns 'false' here instead of an empty array, even though the path it's trying to glob is valid compared to the "open_basedir" settings. I've turned "open_basedir" off, for this single host, but the autoloader still fails to locate / load the class. the new error message is:

Undefined class helpers\Logger

#0 /var/www/clients/client2/web75/web/libs/f3/base.php:1698 F3::error(500,'Undefined class helpers\\Logger')
#1 {closure}(1024,'Undefined class helpers\\Logger','/var/www/clients/client2/web75/web/libs/f3/base.php',1955,array('class'=>'helpers\\Logger','list'=>array('/var/www/clients/client2/web75/web/index.php','/var/www/clients/client2/web75/web/libs/f3/base.php'),'style'=>'helpers\\Logger','auto'=>'libs/FeedWriter','abs'=>'/var/www/clients/client2/web75/web/libs/FeedWriter','raw'=>'helpers/Logger','ok'=>false,'dir'=>'helpers','found'=>'/var/www/clients/client2/web75/web/libs/WideImage/vendor','glob'=>array('/var/www/clients/client2/web75/web/libs/FeedWriter/FeedWriter.php','/var/www/clients/client2/web75/web/libs/FeedWriter/FeedItem.php')))
#2 /var/www/clients/client2/web75/web/libs/f3/base.php:1955 trigger_error('Undefined class helpers\\Logger')
#3 F3::autoload('helpers\\Logger')
#4 /var/www/clients/client2/web75/web/index.php:19 spl_autoload_call('helpers\\Logger')

Are there any known issues with f3 on shared hosting environments? I was not able to dig anything up in the f3 forum regarding this ... :-(

from selfoss.

SSilence avatar SSilence commented on June 6, 2024

Thats curious, I use selfoss also on a shared environment (PHP 5.3.6) and it works fine. I have no idea what the reason could be. Its hard without debugging :/

from selfoss.

aurora avatar aurora commented on June 6, 2024

Mmmm ... i somehow expected this to be your answer. I will try to debug this and probably it turns out to be no issue with selfoss. I did not have any similar issues with any other PHP based software on this machine, though, and i am running quite a lot of different stuff on it. This is really strange ...

from selfoss.

aurora avatar aurora commented on June 6, 2024

YES!!! seems i found the problem, and indeed it had nothing to do with selfoss nor f3. The bug can be closed. Sorry for bothering you with this, Tobi. But maybe other users of selfoss are running into the same issues than me, and so here are my conclusions:

  1. There seems to be a serious problem with glob and open_basedir. The problem is, that with open_basedir enabled glob will return false instead of an empty directory, if no files are found regarding search-pattern and glob settings. This problem was already reported to php dev-team in 2009 but was closed as "bogus" [sic!]: https://bugs.php.net/bug.php?id=47358 -- that was the reason for the first error i got (Invalid argument supplied for foreach()). Maybe a solution would be to prevent f3 to use E_STRICT for error-reporting (see: libs/f3/base.php, line 1687)

  2. "Undefined class helpers\Logger" -- if you are using ISPConfig as managment software for your server, the following might be the problem, why helper classes are not found. ISPConfig seems to apply some strange rights for the the document-root of the virtual host:

    drwx--x--- 13 web75 client2 4,0K 2011-10-04 23:48 web
    

    It's not clear to me, why ISPConfig does not apply the right for reading the directory for the group (client2). After adding it

    chmod g+r web
    

    f3 autoloader has no further issue locating classes found in a subdirectory of document-root (like the helper classes).

from selfoss.

jpoa avatar jpoa commented on June 6, 2024

Well, I sorted it out as well. Posting what I changed here in case someone its the same trouble:

On ISPConfig (with this it works for me)

SuExec - Checked
PHP - ModPHP

Then, on Options, Apache Directives:

php_admin_value open_basedir none

from selfoss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.