1

Just updated our WP install from 4.7.22 to 4.7.23 -- but can't run the db update script, because whenever I rename the 4.7.23 folder to civicrm, I subsequently get 500 internal server errors while trying to load any civicrm pages. Error log indicates a problem at line 41 in CRM/Core/Config.php, which is require_once 'api/api.php'; ... so I searched the previous working iteration (it runs fine when I switch back to 4.7.22) and there is no mention of api/api.php anywhere. So I assume this line is new in 4.7.23, and I have to wonder why it's making civicrm completely unusable for our site.

Ideas?

More detail from the error message:

PHP Fatal error: require_once(): Failed opening required 'api/api.php' (include_path='.:/wp-content/plugins/civicrm/civicrm:/wp-content/plugins/civicrm/civicrm/packages:/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:/wp-content/plugins/civicrm/civicrm/vendor/pear/pear_exception:/wp-content/plugins/civicrm/civicrm/vendor/pear/auth_sasl:/wp-content/plugins/civicrm/civicrm/vendor/pear/net_socket:/wp-content/plugins/civicrm/civicrm/vendor/pear/net_smtp:/wp-content/plugins/civicrm/civicrm/vendor/pear/validate_finance_creditcard:.:/wp-content/plugins/civicrm/civicrm/:/wp-content/plugins/civicrm/civicrm//packages:.:/usr/lib/php:/usr/local/lib/php') in /wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php on line 41

2 Answers 2

1

First, let the record show that I am an idiot.

After uploading 4.7.23 (the new version) to /wp-content/plugins, I neglected to copy the pre-existing civicrm.config.php into /wp-content/plugins/civicrm4.7.23/civicrm ... thereby depriving the system of (at very least) a working value for $civicrm_root.

It was suggested to me that my civicrm.config.php was probably off, and I checked it just to make sure the $civicrm_root value made sense. The value was good, but the file I was checking was located outside of the plugins directory -- this was a clue, and I missed it. As I said, I'm an idiot.

Of course, once I copied the old civicrm.config.php into the new /wp-content/plugins/civicrm/civicrm, everything worked perfectly. Except for CRON jobs, of course -- but that's another matter.

0

Ok that's odd - require_once 'api/api/php'; has been there since CiviCRM switched from SVN to GitHub.

https://github.com/civicrm/civicrm-core/blame/master/CRM/Core/Config.php#L41

enter image description here

So something else is going on; do you perhaps have two civicrm directories in your file structure? Simply renaming 4.7.22 to civicrm-old and 4.7.23 to civicrm will not work. Make sure to move the civicrm-old completely out and away.

Added: make sure you do everything in exact order:

  • move 4.7.23 code out and away
  • revert back to 4.7.22 db
  • move 4.7.22 code -> civicrm
  • make sure it's working
  • remove 4.7.22 code out and way
  • put the 4.7.23 code -> civicrm
  • run the database upgrade script
  • make sure it's working
4
  • Thank you for your answer, Karin. You're absolutely right: require_once 'api/api/php'; is right where it should be in 4.7.22 -- I was in a rush to post my question, and I made the stupid mistake of trusting the search engine in my file manager when it found the string in 4.7.23 and didn't find it in the previous version. I had to open Config.php in 4.7.22 just now to see that it was there. In past updates, I've never had a problem playing the name game with the civicrm directories. Upload the new, rename the new and the old, and run the db update script ... but not this time.
    – Prónay
    Commented Aug 8, 2017 at 2:12
  • That said, moving the old civicrm directory out of my root directory doesn't help. When I do that, I still get a 500 error with every civi page I try to access. Something is amiss in 4.7.23, but I have no idea what.
    – Prónay
    Commented Aug 8, 2017 at 2:41
  • There are no widespread install issues for 4.7.23 so this is specific to your setup/procedures. Added some notes to my answer. Commented Aug 8, 2017 at 14:03
  • Finally realized my omission of pasting the old civicrm.config.php into the new civicrm/civicrm folder was breaking the system. There was no need to move 4.7.22 away -- once I renamed the civicrm folder, it became effectively inactive, and the newly renamed civicrm folder (previously 4.7.23) became active. Now that the current version is installed & working and the db was successfully upgraded, I can remove the 4.7.22 folder.
    – Prónay
    Commented Aug 8, 2017 at 18:18

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.