Error ID: 2:Newscoop:4.0.2:Loader.php:198 during first access to admin on a fresh installation
  • I made a manual setup on a dedicated server with ISPConfig3.
    ISPConfig 3 is an open source hosting panel. So the installation could bee seen like a "hosting server like" setup.

    The application was installed into a subdirectory "v3" of the webroot of one website e.g. example.com/v3/

    Full path is:
    /var/www/clients/client1/web1/web/v3/

    or via a symbolic link:
    /var/www/example.com/web/v3/

    The virtual host is setup properly, and serving an (other) website on the website-root folder ~/web/

    The installation was running smooth.

    After a click on the "Go to administration button" (Url:
    http://example.com/v3/admin/index.php) a error report below was
    displayed. (Which was already send to newscoop-bug@sourcefabric.org.)

    As a result of the error report I was asked to make a forum post about this issue.

    Here we go, first the Error report:

    Newscoop has encountered a problem.
    ________________________________________________________________________

    Please take a minute to send us an email.

    Simply copy and paste the error report below and send it to:
    newscoop-bug@sourcefabric.org.

    Thank you.


    Error Report
    ________________________________________________________________________

    Error ID: 2:Newscoop:4.0.2:Loader.php:198
    Error String: is_readable() [function.is-readable]: open_basedir
    restriction in effect.
    File(/usr/share/php//var/www/clients/client1/web1/web/v3/application/controllers/helpers/FlashMessenger.php) is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/tmp:/var/www/EXAMPLE.COM/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/var/www/clients/client1/web1/web/v1/oc-content/uploads:/var/www/clients/client1/web1/web/v1/oc-content/plugins/printpdf/tcpdf/cache:/var/www/clients/client1/web1/web/v1/oc-content/uploads) Time: Mon, 30 Jul 2012 06:32:33 +0200 Backtrace:
    {closure}() called at [:]
    is_readable() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Loader.php:198]
    Zend_Loader::isReadable() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Loader/PluginLoader.php:389]
    Zend_Loader_PluginLoader::load() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Controller/Action/HelperBroker.php:366]
    Zend_Controller_Action_HelperBroker::_loadHelper() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Controller/Action/HelperBroker.php:155]
    Zend_Controller_Action_HelperBroker::getStaticHelper() called at [/var/www/clients/client1/web1/web/v3/application/modules/admin/Bootstrap.php:126]
    Admin_Bootstrap::_initFlashMessenger() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:667]
    Zend_Application_Bootstrap_BootstrapAbstract::_executeResource() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:620]
    Zend_Application_Bootstrap_BootstrapAbstract::_bootstrap() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:584]
    Zend_Application_Bootstrap_BootstrapAbstract::bootstrap() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Resource/Modules.php:107]
    Zend_Application_Resource_Modules::init() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:681]
    Zend_Application_Bootstrap_BootstrapAbstract::_executeResource() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:624]
    Zend_Application_Bootstrap_BootstrapAbstract::_bootstrap() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application/Bootstrap/BootstrapAbstract.php:584]
    Zend_Application_Bootstrap_BootstrapAbstract::bootstrap() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Application.php:355]
    Zend_Application::bootstrap() called at [/var/www/clients/client1/web1/web/v3/public/index.php:4]
    require_once() called at [/var/www/clients/client1/web1/web/v3/admin.php:4]


    Some more additional information gathered from log files:

    ACCESS.LOG


    123.123.123.123 - - [30/Jul/2012:06:32:33 +0200] "GET /v3/admin/index.php HTTP/1.1
    " 200 970 "http://example.com/v3/install/index.php" "Mozilla/5.0 (X11; Linu
    x i686 on x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"
    123.123.123.123 - - [30/Jul/2012:06:33:17 +0200] "GET /v3/admin/index.php HTTP/1.1
    " 200 970 "http://smartsiamweb.com/v3/install/index.php" "Mozilla/5.0 (X11; Linu
    x i686 on x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"
    123.123.123.123 - - [30/Jul/2012:06:35:26 +0200] "GET /v3/admin/index.php HTTP/1.1
    " 200 970 "-" "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20100101 F
    irefox/14.0.1"
    123.123.123.123 - - [30/Jul/2012:06:37:02 +0200] "GET /v3/admin/index.php HTTP/1.1
    " 200 970 "-" "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20100101 F
    irefox/14.0.1"
    123.123.123.123 - - [30/Jul/2012:06:37:50 +0200] "GET /v3/admin/index.php HTTP/1.1
    " 500 20 "-" "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20100101 Fi
    refox/14.0.1"

    ...

    Calling example.com/v3/ gives a white screen.

    123.123.123.123 - - [30/Jul/2012:06:39:17 +0200] "GET /v3/ HTTP/1.1" 500
    20 "-" "M


    ERROR.LOG

    No related entry (In fact, the last entry in error log occured a long time before
    the installation of Newscoop)

    Remarks:
    Detailed environment information have been provided with the original error report.


    I got a first recommendation to comment open_basedir in php.ini, an idea i really not like for security reasons.

    A solution might be to allow all necessary directories for this website in openbasedir, but which directories need to be accessed outsite /var/www/newscoop (or in this case /var/www/clients/client1/web1/web/)
    I currently allow access to following directories via open_basedir:

    /var/www/clients/client1/web1/web
    /var/www/clients/client1/web1/tmp
    /usr/share/php5
    /tmp
    /usr/share/phpmyadmin
    /usr/share/php

    Any suggestion?

  • 10 Comments sorted by
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    check does folder /usr/share/php exist
  • Yes, the folder is available.

    ls -al /usr/share/php

    total 216
    drwxr-xr-x  15 root root  4096 Jul 24 07:15 .
    drwxr-xr-x 148 root root  4096 Jul 24 07:27 ..
    drwxr-xr-x   2 root root  4096 Jul 18 08:28 Archive
    drwxr-xr-x   4 root root  4096 Jul 18 08:28 Auth
    -rw-r--r--   1 root root 39310 Nov  8  2009 Auth.php
    drwxr-xr-x   3 root root  4096 Jul 24 07:16 .channels
    drwxr-xr-x   2 root root  4096 Jul 18 08:28 Console
    drwxr-xr-x   4 root root  4096 Oct 13  2009 data
    -rw-r--r--   1 root root  2492 Jun 10 09:31 .depdb
    -rw-r--r--   1 root root     0 Jun 10 09:31 .depdblock
    lrwxrwxrwx   1 root root    20 Apr  7 18:13 doc -> ../doc/php-pear/PEAR
    drwxr-xr-x   8 root root  4096 Oct 13  2009 docs
    -rw-r--r--   1 root root  8267 Jun 10 09:31 .filemap
    -rw-r--r--   1 root root 18381 Sep 11  2008 HTTP.php
    drwxr-xr-x   2  500 root  4096 Jun 28  2010 ioncube
    -rw-r--r--   1 root root     0 Jul 24 07:16 .lock
    drwxr-xr-x   2 root root  4096 Jul 18 08:28 OS
    drwxr-xr-x  11 root root  4096 Jul 18 08:28 PEAR
    -rw-r--r--   1 root root  1087 Jun 10 09:31 PEAR5.php
    -rw-r--r--   1 root root 14377 Jun 10 09:31 pearcmd.php
    -rw-r--r--   1 root root 33897 Jun 10 09:31 PEAR.php
    -rw-r--r--   1 root root   926 Jun 10 09:31 peclcmd.php
    drwxr-xr-x   5 root root  4096 Jul 24 07:16 .registry
    drwxr-xr-x   3 root root  4096 Jul 18 08:28 Structures
    -rw-r--r--   1 root root 19967 Jun 10 09:31 System.php
    drwxr-xr-x   5 root root  4096 Oct 13  2009 tests
    drwxr-xr-x   2 root root  4096 Jul 18 08:28 XML

    Note: The server is running a couple of "scripts", e.g. TYPO3, OPENCART, TIKIWIKI without any issue.
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    you didn't set up properly:


    is not within the allowed path(s):
    (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/tmp:/var/www/EXAMPLE.COM/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/var/www/clients/client1/web1/web/v1/oc-content/uploads:/var/www/clients/client1/web1/web/v1/oc-content/plugins/printpdf/tcpdf/cache:/var/www/clients/client1/web1/web/v1/oc-content/uploads)


    there is no /usr/share/php
    Post edited by Andrey Podshivalov at 2012-07-31 11:47:40
  • You are referencing to the error message, before /usr/share/php/ was added to allowed path. (as a result of the error message)

    Please have a look to your email, I have send you a special link.
    Anyway, any other website on this server does not require 
    /usr/share/php/ in the allowed path.

    I believe that this issue is inside the application, The link in the error message
    (/usr/share/php//var/www/clients/client1/web1/web/v3/application/controllers/helpers/FlashMessenger.php)
    makes no sense.

    Where is that link constructed? 
    Where does the // come from?
    Why is there a reference to a not existing file "FlashMessenger.php" in the error message?

    ls -al /var/www/clients/client1/web1/web/v3/application/controllers/helpers/
    total 64
    drwxr-xr-x 2 web1 client1 4096 Jul 30 06:15 .
    drwxr-xr-x 3 web1 client1 4096 Jul 30 06:15 ..
    -rw-r--r-- 1 web1 client1 2320 Jul 30 06:15 Acl.php
    -rw-r--r-- 1 web1 client1 1011 Jul 30 06:15 Article.php
    -rw-r--r-- 1 web1 client1 9206 Jul 30 06:15 Datatable.php
    -rw-r--r-- 1 web1 client1 1291 Jul 30 06:15 Em.php
    -rw-r--r-- 1 web1 client1 2906 Jul 30 06:15 Entity.php
    -rw-r--r-- 1 web1 client1 5227 Jul 30 06:15 GenericDatatable.php
    -rw-r--r-- 1 web1 client1 1395 Jul 30 06:15 Log.php
    -rw-r--r-- 1 web1 client1 1369 Jul 30 06:15 Plupload.php
    -rw-r--r-- 1 web1 client1 1228 Jul 30 06:15 Service.php
    -rw-r--r-- 1 web1 client1 1545 Jul 30 06:15 Sidebar.php
    -rw-r--r-- 1 web1 client1 1470 Jul 30 06:15 Smarty.php



  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    is_readable() called at [/var/www/clients/client1/web1/web/v3/library/Zend/Loader.php:198]

    it's form Zend Framework. As you can see it just tries to check files with different paths.
    I've tested with
    php_admin_value open_basedir /tmp:/var/www/newscoop:/usr/share/pear:/usr/share/php

    and it works for me.
  • Ran PHP Installation Checker on 2012-08-01T09:44:52+00:00

    PHP Extension Errors Tested

    No errors found


    Zend Framework Installation Errors Tested

    No errors found


    SSL Capabilities Errors Tested

    No errors found


    as you will see on phpinfo the basedir is open, but just a white page displayed, whatever I do.

    YouTube API Connectivity Errors Tested

    No errors found


    Afterwards, I re - installed everything again, this time into document root. same result. - error report.

    Then I downloaded the archive to my local machine, opened the archive and looked for application/controllers/helpers/FlashMessenger.php

    There is no FlashMessenger.php

    Just to make sure, that the file I downloded is not corrupted, here the md5 /sha1 values. Could somebody please compare?

    md5sum newscoop-4.0.2.tar.gz
    8871520d9ef6feccde580334bf49fe0f  newscoop-4.0.2.tar.gz

    sha1sum newscoop-4.0.2.tar.gz
    4fb06086ed72db0854623103c8e2f05f683296bb  newscoop-4.0.2.tar.gz

    ls -l newscoop-4.0.2.tar.gz
    68930666 2012-07-12 18:57 newscoop-4.0.2.tar.gz
    Post edited by Mario Zerbe at 2012-08-01 07:52:52
  • Here the new error report, this time installed in "web12"

    Newscoop has encountered a problem.

    Please take a minute to send us an email.

    Simply copy and paste the error report below and send it to: newscoop-bug@sourcefabric.org.

    Thank you.
    Error Report
    Error ID:     2:Newscoop:4.0.2:Loader.php:198
    Error String:     is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/pear//var/www/clients/client1/web12/web/application/controllers/helpers/FlashMessenger.php) is not within the allowed path(s): (/var/www/clients/client1/web12/web:/var/www/clients/client1/web12/tmp:/var/www/example.com/web:/srv/www/example.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/usr/bin/php:/usr/bin:/usr/share/php:/usr/share/pear)
    Time:     Wed, 01 Aug 2012 13:43:15 +0200
    Backtrace:    

    {closure}() called at [:]
    is_readable() called at [/var/www/clients/client1/web12/web/library/Zend/Loader.php:198]
    Zend_Loader::isReadable() called at [/var/www/clients/client1/web12/web/library/Zend/Loader/PluginLoader.php:389]
    Zend_Loader_PluginLoader::load() called at [/var/www/clients/client1/web12/web/library/Zend/Controller/Action/HelperBroker.php:366]
    Zend_Controller_Action_HelperBroker::_loadHelper() called at [/var/www/clients/client1/web12/web/library/Zend/Controller/Action/HelperBroker.php:155]
    Zend_Controller_Action_HelperBroker::getStaticHelper() called at [/var/www/clients/client1/web12/web/application/modules/admin/Bootstrap.php:126]
    Admin_Bootstrap::_initFlashMessenger() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:667]
    Zend_Application_Bootstrap_BootstrapAbstract::_executeResource() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:620]
    Zend_Application_Bootstrap_BootstrapAbstract::_bootstrap() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:584]
    Zend_Application_Bootstrap_BootstrapAbstract::bootstrap() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Resource/Modules.php:107]
    Zend_Application_Resource_Modules::init() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:681]
    Zend_Application_Bootstrap_BootstrapAbstract::_executeResource() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:624]
    Zend_Application_Bootstrap_BootstrapAbstract::_bootstrap() called at [/var/www/clients/client1/web12/web/library/Zend/Application/Bootstrap/BootstrapAbstract.php:584]
    Zend_Application_Bootstrap_BootstrapAbstract::bootstrap() called at [/var/www/clients/client1/web12/web/library/Zend/Application.php:355]
    Zend_Application::bootstrap() called at [/var/www/clients/client1/web12/web/public/index.php:4]
    require_once() called at [/var/www/clients/client1/web12/web/admin.php:4]
    Post edited by Mario Zerbe at 2012-08-01 07:58:06
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    you should check /usr/share/pear/ folder
  • On Debian 6 pear is located in /usr/share/php/PEAR.

    However, I made a symlink from /usr/share/pear to this location /usr/share/php  (since System.php is there)

    A check via check_pear.php in the webroot of newscoop installation also returned: bool(true)

    as it should be.

    Reference: http://pear.php.net/manual/en/installation.checking.php


    Post edited by Mario Zerbe at 2012-08-01 09:22:03
  • I guess I solved it during a new installation.
     (Just a guess, since I need to test the application properly, if everything is really working now.)

    The trick was to edit conf/install_conf.php

    nano conf/install_conf.php

    I changed
    $Campsite['APACHE_USER'] = 'www-data';
    $Campsite['APACHE_GROUP'] = 'www-data';

    to web12 (user) and client1 (group)
    $Campsite['APACHE_USER'] = 'web12';
    $Campsite['APACHE_GROUP'] = 'client1';

    Note: webxy clientxy are the owner:group  of the webspace in ISPConfig 3

    Afterwards, I had access to the admin panel, but the public website reported the error described in CS-4405

    Applying the change http://code.sourcefabric.org/changelog/newscoop?cs=53ae2ea9f66701d92b4001518ec0d37fa1a4d2ce
    solved also this problem.

    :-)

    I found some two other issues, and will open a new discussion as soon as I have tracked them down a bit more. ;-)
    Post edited by Mario Zerbe at 2012-08-02 08:22:46