Answers.Body: <p>In your civicrm.setting.php update the $civicrm_root and template_c path to use <code>/var/sites/j/example.net/public_html</code> instead of <code>/var/sites/c/beta.example.net/public_html/</code> </p>
  
  <p>Thanks</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-01T16:41:37.113Z
Answers.Text: I don't really understand it, but it works. Thanks!
Answers.UserDisplayName: somnolentsurfer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-01T16:05:05.313Z
Answers.LastActivityDate: 2020-04-01T16:50:58.620Z
Answers.LastEditDate: 2020-04-01T16:50:58.620Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm having some problems with the CiviCRM Resource URL setting that I can't get my head around. Set as <code>[civicrm.root]/</code> the System Status screen displays the error 'The Resource URL is not set correctly'. Set as <code>[cms.root]/sites/all/modules/civicrm/</code> everything seems to work fine (<a href="https://civicrm.stackexchange.com/questions/35178/unable-to-upgrade-from-version-5-22-1">until I try to upgrade</a>). But surely both should resolve to the same place?</p>
  
  <p>In the File System Paths section of civicrm.settings.php I have the following:</p>
  
  <pre><code>$civicrm_root = '/var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm';
  if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
    define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/sites/c/beta.example.net/public_html/sites/default/files/civicrm/templates_c/');
  }
  </code></pre>
  
  <p>And in the Site URLs section I have:</p>
  
  <pre><code>if (!defined('CIVICRM_UF_BASEURL')) {
    define( 'CIVICRM_UF_BASEURL'      , 'https://example.net/');
  }
  </code></pre>
  
  <p>Trying to load the with the <code>[civicrm.root]/</code> setting results in a load of javascript errors, of which the following is an example:</p>
  
  <pre><code>[Error] Failed to load resource: The request timed out. (logo_sm.png, line 0) https://var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm/i/logo_sm.png
  </code></pre>
  
  <p>That looks as though $civicrm_root is set incorrectly, but it seems to be right in accordance with the examples given in the comments. What am I missing?</p>
  
  <p><strong>Edit:</strong> If I go to the CiviCRM Resources URLs page and click on ? I see the variables listed as:</p>
  
  <pre><code>[cms.root]  https://example.net/
  [civicrm.root]  https://example.net//var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm/
  [civicrm.files] https://example.net/sites/default/files/civicrm/
  </code></pre>
  
  <p>But if I got to the Directories page and do the same, I see</p>
  
  <pre><code>[cms.root]  /var/sites/j/example.net/public_html
  [civicrm.root]  /var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm
  [civicrm.files] /var/sites/c/beta.example.net/public_html/sites/default/files/civicrm
  </code></pre>
  
  <p>Where are these getting calculated from that means they're producing different results? Particularly that random one with the /j/ in the middle, which I've never seen before anywhere!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-31T16:25:44.487Z
Comments.Text: I had a similar problem after upgrading to 5.23.4 from 5.20.0. Mine was due to cron calling drush with a -r parameter which was a symbolic link to the drupal directory, equivalent but not identical to the path used to specify $civicrm_root. This used to work, but now caused links in emails to have a path like https://example.com/drupal//var/www/clients/client1/web1/web/drupal/sites/all/modules/civicrm/extern/url.php. After changing the drush -r parameter to /var/www/clients/client1/web1/web/drupal my problem was resolved. Check for inconsistent use of symbolic links in all resource paths/urls.
Comments.UserDisplayName: BobS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-31T19:36:43.620Z
Comments.Text: What is your drupal path set in apache or nginx config?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T11:01:41.253Z
Comments.Text: @PradeepNayak How do I find that out? Drupal is installed at /var/sites/example.net/public_html/ but I'm on shared hosting, so I don't have access to anything above /var/sites/example.net/.
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T11:15:54.050Z
Comments.Text: @BobS Any hints on where to start looking? I'm not using drush. I don't have any custom code, and find . -type l -ls returns nothing.
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T12:49:57.463Z
Comments.Text: Can you go to CiviCRM directories page and click on '?' and paste all the variables
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T15:50:15.017Z
Comments.Text: @PradeepNayak Huh. Well that's weird. I've updated the question. And also amended some of the other paths I'd given. As far as I'd ever been aware, my site was in /var/sites/c/beta.example.net/public_html/, so I'd been contracting that to /var/sites/example.net/public_html/ for simplicity. But one of those variables shows /var/sites/j/example.net/public_html/. I've no idea where it's coming from, but I guess that's the problem! I originally built the site on beta.example.net, and my host told me they couldn't update the account, so example.net is support to just alias to beta.example.net.
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T16:08:51.103Z
Comments.Text: I just changed my civicrm.root and CIVICRM_TEMPLATE_COMPILEDIR to use a linked path and got similar results to yours. Try running "realpath /var/sites/c/beta.example.net/public_html". If you see anything other than what you expect, try using that resulting path in your settings file and Directories page instead.
Comments.UserDisplayName: BobS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-01T16:43:03.220Z
Comments.Text: @BobS My host doesn't appear to allow me to run realpath. Thanks a lot though. Pradeep's solution has fixed the issue.
Comments.UserDisplayName: somnolentsurfer
Tags: <civicrm.settings.php><resource-urls>
Title: Resource URL problem
ThreadText: # Resource URL problem
  
  (Asked by: username_0 on 2020-03-31)
  
  I'm having some problems with the CiviCRM Resource URL setting that I can't get my head around. Set as [civicrm.root]/ the System Status screen displays the error 'The Resource URL is not set correctly'. Set as [cms.root]/sites/all/modules/civicrm/ everything seems to work fine (until I try to upgrade). But surely both should resolve to the same place?
  In the File System Paths section of civicrm.settings.php I have the following:
  $civicrm_root = '/var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm';
  if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
    define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/sites/c/beta.example.net/public_html/sites/default/files/civicrm/templates_c/');
  }
  
  And in the Site URLs section I have:
  if (!defined('CIVICRM_UF_BASEURL')) {
    define( 'CIVICRM_UF_BASEURL'      , 'https://example.net/');
  }
  
  Trying to load the with the [civicrm.root]/ setting results in a load of javascript errors, of which the following is an example:
  [Error] Failed to load resource: The request timed out. (logo_sm.png, line 0) https://var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm/i/logo_sm.png
  
  That looks as though $civicrm_root is set incorrectly, but it seems to be right in accordance with the examples given in the comments. What am I missing?
  Edit: If I go to the CiviCRM Resources URLs page and click on ? I see the variables listed as:
  [cms.root]  https://example.net/
  [civicrm.root]  https://example.net//var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm/
  [civicrm.files] https://example.net/sites/default/files/civicrm/
  
  But if I got to the Directories page and do the same, I see
  [cms.root]  /var/sites/j/example.net/public_html
  [civicrm.root]  /var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm
  [civicrm.files] /var/sites/c/beta.example.net/public_html/sites/default/files/civicrm
  
  Where are these getting calculated from that means they're producing different results? Particularly that random one with the /j/ in the middle, which I've never seen before anywhere!
  
  **Tags:** civicrm.settings.php, resource-urls
  
  > **Comments:**
  > **username_1**: I had a similar problem after upgrading to 5.23.4 from 5.20.0. Mine was due to cron calling drush with a -r parameter which was a symbolic link to the drupal directory, equivalent but not identical to the path used to specify $civicrm_root. This used to work, but now caused links in emails to have a path like https://example.com/drupal//var/www/clients/client1/web1/web/drupal/sites/all/modules/civicrm/extern/url.php. After changing the drush -r parameter to /var/www/clients/client1/web1/web/drupal my problem was resolved. Check for inconsistent use of symbolic links in all resource paths/urls.  
  > **username_2**: What is your drupal path set in apache or nginx config?  
  > **username_0**: @PradeepNayak How do I find that out? Drupal is installed at /var/sites/example.net/public_html/ but I'm on shared hosting, so I don't have access to anything above /var/sites/example.net/.  
  > **username_0**: @username_1 Any hints on where to start looking? I'm not using drush. I don't have any custom code, and find . -type l -ls returns nothing.  
  > **username_2**: Can you go to CiviCRM directories page and click on '?' and paste all the variables  
  > **username_0**: @PradeepNayak Huh. Well that's weird. I've updated the question. And also amended some of the other paths I'd given. As far as I'd ever been aware, my site was in /var/sites/c/beta.example.net/public_html/, so I'd been contracting that to /var/sites/example.net/public_html/ for simplicity. But one of those variables shows /var/sites/j/example.net/public_html/. I've no idea where it's coming from, but I guess that's the problem! I originally built the site on beta.example.net, and my host told me they couldn't update the account, so example.net is support to just alias to beta.example.net.  
  > **username_1**: I just changed my civicrm.root and CIVICRM_TEMPLATE_COMPILEDIR to use a linked path and got similar results to yours. Try running "realpath /var/sites/c/beta.example.net/public_html". If you see anything other than what you expect, try using that resulting path in your settings file and Directories page instead.  
  > **username_0**: @username_1 My host doesn't appear to allow me to run realpath. Thanks a lot though. Pradeep's solution has fixed the issue.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-04-01. Score: 3 | Accepted answer
  
  In your civicrm.setting.php update the $civicrm\_root and template\_c path to use `/var/sites/j/example.net/public_html` instead of `/var/sites/c/beta.example.net/public_html/`
  
  Thanks
  
  Pradeep
  
  > **Comments:**
  > **username_0**: I don't really understand it, but it works. Thanks!  
  
  ---
  
  