Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

Hard-coded paths in Providence

I have been having difficulties deploying the Providence 1.7.8 release onto my server. In order to test installation, I have created a new MySQL database and unzipped a fresh install of providence-1.7.8 to /usr/local/projects/providence. Note that a previous installation existed at /usr/local/projects/providence-1.7.8, which I have deleted.

When I update setup.php and navigate to the /install path in my browser, I get the following errors:

 Warning: require_once(/usr/local/projects/providence-1.7.8/app/lib/Zend/Cache.php): failed to open stream: No such file or directory in /usr/local/projects/providence/app/helpers/preload.php on line 40

 Fatal error: require_once(): Failed opening required '/usr/local/projects/providence-1.7.8/app/lib/Zend/Cache.php' (include_path='/usr/local/projects/providence/vendor/pear/archive_tar:/usr/local/projects/providence/vendor/pear/console_getopt:/usr/local/projects/providence/vendor/pear/file_marc:/usr/local/projects/providence/vendor/pear/pear-core-minimal/src:/usr/local/projects/providence/vendor/pear/pear_exception:/var/www/html/collectiveaccess/app/lib:/var/www/html/collectiveaccess/app/models:.:/usr/share/php') in /usr/local/projects/providence/app/helpers/preload.php on line 40

As you can see, CA is attempting to load php files in the /usr/local/projects/providence-1.7.8 path, which no longer exists. There should be no reference to this in the freshly unzipped CA nor in the database I just created. Does the script for Providence modify PHP files within my system beyond its own directory?

If I rename providence to providence-1.7.8, and go to /install again, I get this error:

 Warning: require_once(/usr/local/projects/providence/app/helpers/requestHelpers.php): failed to open stream: No such file or directory in /usr/local/projects/providence-1.7.8/app/helpers/post-setup.php on line 146

Fatal error: require_once(): Failed opening required '/usr/local/projects/providence/app/helpers/requestHelpers.php' (include_path='/var/www/html/collectiveaccess/app/lib:/var/www/html/collectiveaccess/app/models:.:/usr/share/php') in /usr/local/projects/providence-1.7.8/app/helpers/post-setup.php on line 146

Something is clearly wrong with absolute paths.


  • Try clearing the cache in app/tmp. Also make sure there are no hardcoded paths set it in setup.php. The paths are derived from constants in setup.php and post-setup.php.

  • I deleted the cache, and have the following error. I think it's getting a little easier to track down now:

     Warning: require_once(/usr/local/projects/providence/app/lib/Db/DbStatement.php): failed to open stream: No such file or directory in /usr/local/projects/providence-1.7.8/app/lib/Db.php on line 38
     Fatal error: require_once(): Failed opening required '/usr/local/projects/providence/app/lib/Db/DbStatement.php' (include_path='/usr/local/projects/providence-1.7.8/vendor/pear/archive_tar:/usr/local/projects/providence-1.7.8/vendor/pear/console_getopt:/usr/local/projects/providence-1.7.8/vendor/pear/file_marc:/usr/local/projects/providence-1.7.8/vendor/pear/pear-core-minimal/src:/usr/local/projects/providence-1.7.8/vendor/pear/pear_exception:/var/www/html/collectiveaccess/app/lib:/var/www/html/collectiveaccess/app/models:.:/usr/share/php') in /usr/local/projects/providence-1.7.8/app/lib/Db.php on line 38

    The specific php file changes every time I refresh, but all of the lines correspond to the __CA_LIB_DIR__ constant. Note: in this case /usr/local/projects/providence-1.7.8 exists and /usr/local/projects/providence does not. So it appears that __CA_LIB_DIR__ is set somewhere to /usr/local/projects/providence. I found that this is defined in post-setup.php, and working backwards I see it's connected to the definition of PATHINFO_DIRNAME. However, I lose it from there. I'm not seeing where this is defined.

     define("__CA_BASE_DIR__", pathinfo(preg_replace("!/install|/viewers/apps|/tests|support/bin/!", "", isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : __FILE__), PATHINFO_DIRNAME));

    Is this in the stored in the database somewhere?

  • These can be set in setup.php with fallback defaults set in post-setup.php. The code you found for CA_BASE_DIR in post-setup.php is trying to determine the base path. These values are not stored in the database and should not be cached. It's possible (but unlikely) that the issue is a PHP code cache. Are you running PHP as FCGI?

    You may want to just set CA_BASE_DIR in setup.php to the root of your CA install. That may well fix the issue.


  • I set CA_BASE_DIR, then unset it, and refreshed several times. There seemed to be some sort of caching issue, but I have resolved it.

Sign In or Register to comment.