6

Issue began with -

Wordpress 4.2.2 CiviCRM 4.6.2 (later 4.6.3 - see below) Php 5.4.33

About 5 days ago on Wordpress installation we were suddenly unable to click into the CiviCRM dashboard via Wordpress backend. The only thing that may have happened that we can see is that a automatic backup may have been attempted but there was not enough server disk space for the back up. The disk has been cleaned out and there is plenty of space now.

When attempting to head to civi - the dashboard icons never stop spinning and there is a Warning at top of page that reads:

Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 386

With no civicrm menus, I did have partial functionality via URLS of some admin pages such as to Admin / Settings / Upload directories - nothing appears wrong there - but almost nothing works..

Cron was also spitting me the full warning:

Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 386

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php on line 132

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php on line 132

Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 386

__

I note two similar cases - both seem unresolved: http://forum.civicrm.org/index.php?topic=36378.0 where the file is exactly the same - File(/home/wp-includes/version.php)

And there is also the post here: How do I correct the fault causing "file_exists(): open_basedir restriction in effect" - But this is a different file - and there is no response how that went.

SO - I attempted to upgrade to latest CiviCRM 4.6.3 - There was a warning to update some customised receipt templates, but then the upgrade failed with the warnings:

Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 394

Warning: Cannot modify header information - headers already sent by (output started at /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:394) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 413

Note the new line numbers..

I am stuck for ideas - any help greatly appreciated

Chris

0

1 Answer 1

4

Another potential cause is that Civi's WordPress.php file is incorrectly guessing the path to your WP install. You can force the path in your civicrm.settings.php file, like so:

define('CIVICRM_CMSDIR','/home/bmeeco/public_html/wordpress');

Edit: I think you've actually found a bug (CRM-14987). The way it guesses the WP path can cause warnings (it's almost guaranteed to if you are on cheap shared hosting). My solution will get you by, however.

6
  • Yes! Nicholai - thanks you so much - this resolved the issue for me. May 28, 2015 at 23:01
  • Glad to hear it! Please consider marking it as the accepted answer for people in the future who are searching on the same problem.
    – Nicholai
    May 28, 2015 at 23:15
  • Ahh yes - i see the tick now - done - and thanks again - I am doing the happy chicken dance in your honour May 28, 2015 at 23:30
  • 1
    I need to add an aside. There was a requirement for me to create a new version of civicrm on a fresh install of wordpress on the same shared host and mysql db from my original question above. As I was progressing through the installation steps, once I had all the green lights on the civicrm installer screen - the open_basedir restriction Warning re-appeared. So this was before CiviCRM was fully installed. I was able to proceed successfully through the install, then edited the new civicrm.settings.php with Nicholai's code (altered to fit new location) and once again this was resolved. Jun 10, 2015 at 2:26
  • I have CIVICRM_CMSDIR defined, but still get the open_basedir error when trying to generate address labels. Is there another config parameter that is not set in that case? Sep 10, 2015 at 20:59

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.