Body: <p>I am trying to execute cron.php for all Civicrm jobs through the Anacron tab on the cpanel of Gandi, but I keep getting &quot;execute_all_jobs: PHP Fatal error:  require_once(): Failed opening required '../civicrm.config.php&quot;
  I have tried setting permissions on bin and cron.php to 777, and also with and without username/password/site key.
  Additionally, I get a &quot;page not found&quot; if I try to use a URL call</p>
  <p>Any suggestions? Please?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-26T03:20:42.477Z
Comments.Text: What command are you using to run cron? https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#commands
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-26T07:30:36.227Z
Comments.Text: I am using the URL method, through the GANDI control panel Anacron tab. I have 2 php crons set up for process_mailing and fetch_bounces, and one for execute_all_jobs, but all of them give me a "input file not found" result with or without username/password/site key.
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T14:49:38.997Z
Comments.Text: UPDATE: I added a query string, but now it said Can't open file.
  I looked at civcrm-settings.php and the user Framework ResourceURL doesn't contain htdocs in the path, but global $civicrm does (which is the absolute path I am using for cron - with htdocs). When I tried to add htdocs to the user Framework Resource URL, CivicCRM did not display correctly.
  Any ideas?
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T14:59:53.853Z
Comments.Text: Can you edit the original question to show the exact command you are using (except passwords)? And are you using wget or curl or something else?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T15:26:15.450Z
Comments.Text: this is the command suggested by GANDI (with the name, pass and key redacted:
  @hourly 0 execute_all_jobs php -f /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin$ php /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin/cron.php?&name=[name]&pass=[pass]&key=[key]
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T15:37:21.730Z
Comments.Text: sorry, it is this now, with the query:
  @hourly 0 execute_all_jobs php -f /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin$ php /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin/cron.php '&name=[name]&pass=[pass]&key=[key]'
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T16:36:18.643Z
Comments.Text: Ok I see that's not the right command. If you want to use the URL method, then the command is not `php`, it is `curl` or `wget` as described at docs I linked above.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T17:34:21.363Z
Comments.Text: But the GANDI DOCS say:
  
  You can also execute scripts written in PHP. To do this, you will need to use the php command, along with the -f option, and the path to the file.
  
  Your files will still be located at the same location (/srv/data/web/vhosts), followed by the directory of the VHOST and the path to the file within the code of your application.
  
  In the following example, we execute a file called cron.php daily at the root of www.example.com.
  
  @daily 0 my_php_script php -f /srv/data/web/vhosts/www.example.com/cron.php
  
  so, does this need to be different for CiviCRM crons???
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-29T17:41:50.797Z
Comments.Text: I see the confusion but the url method works by simulating a web browser visiting a url so it's not running a command line php script. You need to use curl or similar to simulate the web browser, not php.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-30T12:01:49.610Z
Comments.Text: i don't understand how to use curl. there is no curl directory in /bin, so do i need to create one? and, if so, what file do i create to put in there?
Comments.UserDisplayName: Hilary Binder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-30T13:23:57.277Z
Comments.Text: Also, is there possibly an issue with the htdocs  being in the Framework Resource path, but not $global civicrm...as i mentioned above
Comments.UserDisplayName: Hilary Binder
Tags: <cron><scheduled-job>
Title: anacron not executing scheduled jobs
ThreadText: # anacron not executing scheduled jobs
  
  (Asked by: username_0 on 2022-12-24)
  
  I am trying to execute cron.php for all Civicrm jobs through the Anacron tab on the cpanel of Gandi, but I keep getting "execute\_all\_jobs: PHP Fatal error: require\_once(): Failed opening required '../civicrm.config.php"
  I have tried setting permissions on bin and cron.php to 777, and also with and without username/password/site key.
  Additionally, I get a "page not found" if I try to use a URL call
  
  Any suggestions? Please?
  
  **Tags:** cron, scheduled-job
  
  > **Comments:**
  > **username_1**: What command are you using to run cron? https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#commands  
  > **username_0**: I am using the URL method, through the GANDI control panel Anacron tab. I have 2 php crons set up for process_mailing and fetch_bounces, and one for execute_all_jobs, but all of them give me a "input file not found" result with or without username/password/site key.  
  > **username_0**: UPDATE: I added a query string, but now it said Can't open file. I looked at civcrm-settings.php and the user Framework ResourceURL doesn't contain htdocs in the path, but global $civicrm does (which is the absolute path I am using for cron - with htdocs). When I tried to add htdocs to the user Framework Resource URL, CivicCRM did not display correctly. Any ideas?  
  > **username_1**: Can you edit the original question to show the exact command you are using (except passwords)? And are you using wget or curl or something else?  
  > **username_0**: this is the command suggested by GANDI (with the name, pass and key redacted: @hourly 0 execute_all_jobs php -f /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin$ php /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin/cron.php?&name=[name]&pass=[pass]&key=[key]  
  > **username_0**: sorry, it is this now, with the query: @hourly 0 execute_all_jobs php -f /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin$ php /srv/data/web/vhosts/hungeractionnys.org/htdocs/wp-content/plugins/civicrm/civicrm/bin/cron.php '&name=[name]&pass=[pass]&key=[key]'  
  > **username_1**: Ok I see that's not the right command. If you want to use the URL method, then the command is not `php`, it is `curl` or `wget` as described at docs I linked above.  
  > **username_0**: But the GANDI DOCS say:  You can also execute scripts written in PHP. To do this, you will need to use the php command, along with the -f option, and the path to the file.  Your files will still be located at the same location (/srv/data/web/vhosts), followed by the directory of the VHOST and the path to the file within the code of your application.  In the following example, we execute a file called cron.php daily at the root of www.example.com.  @daily 0 my_php_script php -f /srv/data/web/vhosts/www.example.com/cron.php  so, does this need to be different for CiviCRM crons???  
  > **username_1**: I see the confusion but the url method works by simulating a web browser visiting a url so it's not running a command line php script. You need to use curl or similar to simulate the web browser, not php.  
  > **username_0**: i don't understand how to use curl. there is no curl directory in /bin, so do i need to create one? and, if so, what file do i create to put in there?  
  > **username_0**: Also, is there possibly an issue with the htdocs  being in the Framework Resource path, but not $global civicrm...as i mentioned above  
  
  ---
  
  ## 0 answers
  
  