Answers.Body: <p>The &quot;save_path&quot; value is fine which specifies the directory for the PHP session cache. The problem is that directory does not exist on the Bluehost server.</p>
  <p>I brought this to Bluehost's attention but they initially refused to fix the issue. They eventually did correct their server after several arduous chats with Bluehost.</p>
  <p>While waiting for Bluehost to finally fix this issue, the workaround described in my &quot;Mar20&quot; update allowed us to proceed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-29T17:12:02.417Z
Answers.LastActivityDate: 2024-03-31T17:12:34.243Z
Answers.LastEditDate: 2024-03-31T17:12:34.243Z
Answers.UserDisplayName: Art
Answers.Body: <p>Welcome to SE.  The message says:</p>
  <blockquote>
  <p>We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.</p>
  </blockquote>
  <blockquote>
  <p>Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is <a href="http://example.org" rel="nofollow noreferrer">http://example.org</a>, but some users are accessing the page via <a href="http://www.example.org" rel="nofollow noreferrer">http://www.example.org</a> or a domain alias like <a href="http://myotherexample.org" rel="nofollow noreferrer">http://myotherexample.org</a>.</p>
  </blockquote>
  <ol>
  <li>Are cookies enabled in your browser?</li>
  <li>Are you using the same url to access the page as is configured in your civicrm.settings.php?</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-07T21:56:24.897Z
Answers.Text: - Yes, cookies are enabled in my browser.  
  - Yes, I verified the 'CIVICRM_UF_BASEURL' at all steps above match the value in civicrm.settings.php.  
  
  - I also tried to enable debugging via "Administer menu > System Settings > Debugging and Error Handling" - but after clicking "Save" I get the same error.  
  
  - Is there a different mechanism I can use to enable debugging?
Answers.UserDisplayName: Art
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-10T21:06:52.767Z
Answers.Text: Other thing to check - which you probably have done - is having a mix of settings for http and https
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-07T10:24:39.473Z
Answers.LastActivityDate: 2024-03-07T10:24:39.473Z
Answers.UserDisplayName: Aidan
Body: <p><strong>Note:</strong> Search below for the '==========' pattern to jump to updates on this ticket.</p>
  <p>I just downloaded and activated CiviCRM (Version 5.70.2) for WordPress, and I noticed a &quot;System Status: Warning&quot; on the CiviCRM Home Page.</p>
  <ul>
  <li>I clicked on the &quot;View Details and Manage Alerts&quot; link to view the &quot;CiviCRM System Status&quot; page.</li>
  <li>In the &quot;Organization Setup&quot; section of that page it asked me to &quot;Please enter your organization's <strong>name</strong>, primary address and default FROM Email Address (for system-generated emails).&quot;</li>
  <li>I clicked on <strong>name</strong> and this took me to the &quot;Organization Address and Contact Info&quot; page.</li>
  <li>I filled in the required fields on that page and clicked &quot;Save&quot; at the bottom.</li>
  <li>This results in an error that ends with &quot;Could not find a valid session key.&quot; (full message below)</li>
  </ul>
  <p>This is very easy to reproduce.</p>
  <p>I poked around a bit and found a log, specifically: ./wp-content /uploads /civicrm /ConfigAndLog /<strong>CiviCRM.1.f41ba7ebd6ad6ac9b22ac471.log</strong></p>
  <p>Here is the stack trace in that log file every time I reproduce this issue:</p>
  <pre><code> trace: {
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:872 {
          CRM_Core_Controller-&gt;invalidKeyCommon()
          &gt;   $msg = ts(&quot;We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.&quot;) . '&lt;br /&gt;&lt;br /&gt;' . ts('Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.') . '&lt;br /&gt;&lt;br /&gt;' . ts('Error type: Could not find a valid session key.');
          &gt;   throw new CRM_Core_Exception($msg);
          &gt; }
        }
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:867 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:316 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:193 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller/Simple.php:49 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php:61 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:292 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm.php:1231 { ...}
        /home4/uvfousor/public_html/wp-includes/class-wp-hook.php:324 { ...}
        /home4/uvfousor/public_html/wp-includes/class-wp-hook.php:348 { ...}
        /home4/uvfousor/public_html/wp-includes/plugin.php:517 { ...}
        /home4/uvfousor/public_html/wp-admin/admin.php:259 { ...}
      }
    }
  </code></pre>
  <p>Please let me know what I need to do to resolve this issue. Thanks!</p>
  <p>==============<br />
  Friday - Mar08: While waiting for a response from @Aidan (or anyone else) I made an attempt to gain some insight on what might be the root cause.</p>
  <p>I initially tried to enable debugging via &quot;Administer menu &gt; System Settings &gt; Debugging and Error Handling&quot; - but after clicking &quot;Save&quot; I get the same &quot;Could not find a valid session key&quot; error.</p>
  <p>So, instead, I added some debug statements using the CRM_Core_Error::debug_log_message() method.
  I sprinkled these debug statements in civicrm/CRM/Core/Controller.php and civicrm/CRM/Core/Key.php.</p>
  <p>Essentially, this is what I see...</p>
  <ul>
  <li>When I click on &quot;<strong>name</strong>&quot;, I see a call to the Key.php::sign() method with name=CRM_Contact_Form_Domain key=...CYQ==</li>
  <li>I then see a composite key saved at Line Controller.php::319 that uses that &quot;...CYQ==&quot; key.</li>
  <li>When I click SAVE, I see another call to sign() with name=CRM_Contact_Controller_Search, but with a different privateKey=...oKq==. This appears to overwrite the previous value.</li>
  <li>In the same step, I see it retrieve the composite key and call the Key.php::validate() method.</li>
  <li>However, I believe (this is a guess) that method is trying to validate against the most recent key (...oKq==) when it should use the &quot;...CYQ==&quot; key?</li>
  </ul>
  <p>Hopefully, the above observations will trigger a memory for someone on this forum.</p>
  <p>In the meantime, I am repeating my response to @Aidan (because the formatting is better in this area):</p>
  <ol>
  <li>Yes, cookies are enabled in my browser.</li>
  <li>Yes, I verified the 'CIVICRM_UF_BASEURL' at all steps above match the value in civicrm.settings.php.</li>
  </ol>
  <p>==============<br />
  Sunday - Mar10: I don't believe this is a client issue as the same problem occurs on different PCs and different browsers. So, there must be something unique in my environment on the &quot;https://uv4sor.org&quot; wordpress server to explain why no one else sees this issue. <strong>CIVICRM experts</strong> - What can I collect to help identify the root cause?</p>
  <p>==============<br />
  Monday - Mar11: I chatted with Bluehost support and they said &quot;most  of the plugins works in an older version of PHP&quot;, so as an experiment they downgraded PHP Version 8.2 to Version 7.4.</p>
  <p>Interestingly, this got me past my original strange error and I was able to update the &quot;Organization Address and Contact Info&quot; page.</p>
  <p>Bluehost also tried PHP Version 8.1 but this also shows the strange error, so they put it back to Version 7.4.</p>
  <p>This experiment suggests there is some software on the host that CiviCRM requires, but that software fails with PHP8.2 and works with PHP7.4.</p>
  <p>Perhaps that software needs to be updated on the host, but I have no clue on how to identify it.</p>
  <p>Does anyone on this forum have a suggestion?</p>
  <p>==============<br />
  Tuesday - Mar12: While on PHP7.4 I successfully enabled debugging to check if it reports anything interesting. I then switched to PHP8.1 and ran my test to generate the error with debug information. It seems to report the same information described in the original error, so not to helpful. I returned PHP back to 7.4.</p>
  <p>Thanks to @Aidan for suggesting two other experiments to check if cookies are being sent but are not getting through - which is where a firewall or caching might affect things.</p>
  <ul>
  <li>First, I set WP &quot;Cache Level&quot; to &quot;Off&quot; and tested again with PHP8.2. I then ran the test again and verified the error is still there. I returned PHP back to 7.4.</li>
  <li>Second, I change WordFence &quot;Web Application Firewall Status&quot; from &quot;Enabled and Protecting&quot; to &quot;Disabled&quot; and tested again with PHP8.2. I then ran the test again and verified the error is still there. I returned PHP back to 7.4.</li>
  </ul>
  <p>Unfortunately, no progress with identifying the root cause. Please let me know if anyone has another test I can run to help explain why Civi works with PHP7.4 but fails with PHP8.x.</p>
  <p>==============<br />
  Thursday - Mar14: We thought we had something when we saw following error:</p>
  <pre><code>[13-Mar-2024 00:02:33 UTC] PHP Warning:  session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php81) in /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm.php on line 494
  </code></pre>
  <p>We wondered if Civi needs access to the  &quot;/var/cpanel&quot; directory. Currently, that directory is owned by 'root' and not readable by 'others', specifically:</p>
  <pre><code>uvfousor@uv4sor.org [~]# ls -ld /var/cpanel
  drwx--x--x 125 root root 12288 Mar 12 19:44 /var/cpanel/
  </code></pre>
  <p>However, I checked with the cPanel forum and they report that directory &quot;should be the 711 root:root like you are seeing.&quot;</p>
  <p>I am curious to learn why civicrm.php is trying to access that directory. Perhaps that will lead  to the root cause.</p>
  <p>I am interested in digging deeper with instrumenting Civi code with debug statements. Can anyone suggest a good place to start to help identify the root cause?</p>
  <p>==============<br />
  Wednesday - Mar20: Thanks to @Aidan for suggesting something is wrong with the &quot;save_path&quot; variable in the PHP8.1 environment, and suggesting I play with the <strong>session_save_path()</strong> function. I added a session_save_path('path/to/writable/directory') in CiviCRM's <strong>maybe_start_session()</strong> function, and my test is NOW passing.</p>
  <p>The next step is to learn who (or what) is responsible for managing the &quot;save_path&quot; variable.</p>
  
Tags: <wordpress><error>
Title: Getting strange error after Activating CiviCRM in WordPress
ThreadText: # Getting strange error after Activating CiviCRM in WordPress
  
  (Asked by: username_0 on 2024-03-07)
  
  **Note:** Search below for the '==========' pattern to jump to updates on this ticket.
  
  I just downloaded and activated CiviCRM (Version 5.70.2) for WordPress, and I noticed a "System Status: Warning" on the CiviCRM Home Page.
  
  * I clicked on the "View Details and Manage Alerts" link to view the "CiviCRM System Status" page.
  * In the "Organization Setup" section of that page it asked me to "Please enter your organization's **name**, primary address and default FROM Email Address (for system-generated emails)."
  * I clicked on **name** and this took me to the "Organization Address and Contact Info" page.
  * I filled in the required fields on that page and clicked "Save" at the bottom.
  * This results in an error that ends with "Could not find a valid session key." (full message below)
  
  This is very easy to reproduce.
  
  I poked around a bit and found a log, specifically: ./wp-content /uploads /civicrm /ConfigAndLog /**CiviCRM.1.f41ba7ebd6ad6ac9b22ac471.log**
  
  Here is the stack trace in that log file every time I reproduce this issue:
  
  ```
   trace: {
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:872 {
          CRM_Core_Controller->invalidKeyCommon()
          >   $msg = ts("We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.") . '<br /><br />' . ts('Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.') . '<br /><br />' . ts('Error type: Could not find a valid session key.');
          >   throw new CRM_Core_Exception($msg);
          > }
        }
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:867 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:316 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:193 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller/Simple.php:49 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php:61 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:292 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { ...}
        /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm.php:1231 { ...}
        /home4/uvfousor/public_html/wp-includes/class-wp-hook.php:324 { ...}
        /home4/uvfousor/public_html/wp-includes/class-wp-hook.php:348 { ...}
        /home4/uvfousor/public_html/wp-includes/plugin.php:517 { ...}
        /home4/uvfousor/public_html/wp-admin/admin.php:259 { ...}
      }
    }
  
  ```
  
  Please let me know what I need to do to resolve this issue. Thanks!
  
  ==============  
  Friday - Mar08: While waiting for a response from @username_1 (or anyone else) I made an attempt to gain some insight on what might be the root cause.
  
  I initially tried to enable debugging via "Administer menu > System Settings > Debugging and Error Handling" - but after clicking "Save" I get the same "Could not find a valid session key" error.
  
  So, instead, I added some debug statements using the CRM\_Core\_Error::debug\_log\_message() method.
  I sprinkled these debug statements in civicrm/CRM/Core/Controller.php and civicrm/CRM/Core/Key.php.
  
  Essentially, this is what I see...
  
  * When I click on "**name**", I see a call to the Key.php::sign() method with name=CRM\_Contact\_Form\_Domain key=...CYQ==
  * I then see a composite key saved at Line Controller.php::319 that uses that "...CYQ==" key.
  * When I click SAVE, I see another call to sign() with name=CRM\_Contact\_Controller\_Search, but with a different privateKey=...oKq==. This appears to overwrite the previous value.
  * In the same step, I see it retrieve the composite key and call the Key.php::validate() method.
  * However, I believe (this is a guess) that method is trying to validate against the most recent key (...oKq==) when it should use the "...CYQ==" key?
  
  Hopefully, the above observations will trigger a memory for someone on this forum.
  
  In the meantime, I am repeating my response to @username_1 (because the formatting is better in this area):
  
  1. Yes, cookies are enabled in my browser.
  2. Yes, I verified the 'CIVICRM\_UF\_BASEURL' at all steps above match the value in civicrm.settings.php.
  
  ==============  
  Sunday - Mar10: I don't believe this is a client issue as the same problem occurs on different PCs and different browsers. So, there must be something unique in my environment on the "https://uv4sor.org" wordpress server to explain why no one else sees this issue. **CIVICRM experts** - What can I collect to help identify the root cause?
  
  ==============  
  Monday - Mar11: I chatted with Bluehost support and they said "most of the plugins works in an older version of PHP", so as an experiment they downgraded PHP Version 8.2 to Version 7.4.
  
  Interestingly, this got me past my original strange error and I was able to update the "Organization Address and Contact Info" page.
  
  Bluehost also tried PHP Version 8.1 but this also shows the strange error, so they put it back to Version 7.4.
  
  This experiment suggests there is some software on the host that CiviCRM requires, but that software fails with PHP8.2 and works with PHP7.4.
  
  Perhaps that software needs to be updated on the host, but I have no clue on how to identify it.
  
  Does anyone on this forum have a suggestion?
  
  ==============  
  Tuesday - Mar12: While on PHP7.4 I successfully enabled debugging to check if it reports anything interesting. I then switched to PHP8.1 and ran my test to generate the error with debug information. It seems to report the same information described in the original error, so not to helpful. I returned PHP back to 7.4.
  
  Thanks to @username_1 for suggesting two other experiments to check if cookies are being sent but are not getting through - which is where a firewall or caching might affect things.
  
  * First, I set WP "Cache Level" to "Off" and tested again with PHP8.2. I then ran the test again and verified the error is still there. I returned PHP back to 7.4.
  * Second, I change WordFence "Web Application Firewall Status" from "Enabled and Protecting" to "Disabled" and tested again with PHP8.2. I then ran the test again and verified the error is still there. I returned PHP back to 7.4.
  
  Unfortunately, no progress with identifying the root cause. Please let me know if anyone has another test I can run to help explain why Civi works with PHP7.4 but fails with PHP8.x.
  
  ==============  
  Thursday - Mar14: We thought we had something when we saw following error:
  
  ```
  [13-Mar-2024 00:02:33 UTC] PHP Warning:  session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php81) in /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm.php on line 494
  
  ```
  
  We wondered if Civi needs access to the "/var/cpanel" directory. Currently, that directory is owned by 'root' and not readable by 'others', specifically:
  
  ```
  uvfousor@uv4sor.org [~]# ls -ld /var/cpanel
  drwx--x--x 125 root root 12288 Mar 12 19:44 /var/cpanel/
  
  ```
  
  However, I checked with the cPanel forum and they report that directory "should be the 711 root:root like you are seeing."
  
  I am curious to learn why civicrm.php is trying to access that directory. Perhaps that will lead to the root cause.
  
  I am interested in digging deeper with instrumenting Civi code with debug statements. Can anyone suggest a good place to start to help identify the root cause?
  
  ==============  
  Wednesday - Mar20: Thanks to @username_1 for suggesting something is wrong with the "save\_path" variable in the PHP8.1 environment, and suggesting I play with the **session\_save\_path()** function. I added a session\_save\_path('path/to/writable/directory') in CiviCRM's **maybe\_start\_session()** function, and my test is NOW passing.
  
  The next step is to learn who (or what) is responsible for managing the "save\_path" variable.
  
  **Tags:** wordpress, error
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2024-03-29. Score: 2 | Accepted answer
  
  The "save\_path" value is fine which specifies the directory for the PHP session cache. The problem is that directory does not exist on the Bluehost server.
  
  I brought this to Bluehost's attention but they initially refused to fix the issue. They eventually did correct their server after several arduous chats with Bluehost.
  
  While waiting for Bluehost to finally fix this issue, the workaround described in my "Mar20" update allowed us to proceed.
  
  
  ---
  
  ### Answer by username_1 on 2024-03-07. Score: 1
  
  Welcome to SE. The message says:
  
  > We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.
  
  > Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is <http://example.org>, but some users are accessing the page via <http://www.example.org> or a domain alias like <http://myotherexample.org>.
  
  1. Are cookies enabled in your browser?
  2. Are you using the same url to access the page as is configured in your civicrm.settings.php?
  
  > **Comments:**
  > **username_0**: - Yes, cookies are enabled in my browser.   - Yes, I verified the 'CIVICRM_UF_BASEURL' at all steps above match the value in civicrm.settings.php.    - I also tried to enable debugging via "Administer menu > System Settings > Debugging and Error Handling" - but after clicking "Save" I get the same error.    - Is there a different mechanism I can use to enable debugging?  
  > **username_2**: Other thing to check - which you probably have done - is having a mix of settings for http and https  
  
  ---
  
  