Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Requires: phpFox 4.4.0+Cron jobs in v4

Since version 4.4.0+ , cron jobs system of phpFox is required the site admin have to set it up manually. Cron jobs of phpFox are used for Groups App notifications and also for importing old groups from prior v4 versions to the Groups App in v4.4.0+ should you choose to do so. You will need to set up a cron job in order to have the Groups notifications work. 

The file for running phpFox cron jobs is "cron.php" that is stored in the phpFox root folder (Ex: /var/www/html/phpfox). We suggest that you config to execute the file every 5 minutes. In the below example, we set 5 minutes and our example path_to_phpfox_dir is /var/www/html/phpfox.

There some core features such as Groups converting, Groups notifications, Downgrade Expired Subscribers... So, it is necessary to set up cron jobs system to make sure that the phpFox site can work well as design.  Below is some instructions to help the admin can set up the phpFox cron job system easily.

First step to set up new cron jobs system is get the path of cron file of your phpFox site. Log in to AdminCP, go to Setting → Cron and copy the PATH. The PATH is some thing like that "<path_to_phpfox_root_dir>/cron.php".

Image Added

Second, we need to configure cron job on the server. There are several ways to configure cron job, depend on your web server environment.

Setup from cPanel (Mostly use for share hosting)

...

Via Web Hosting Control Panel

 cPanel

  • Step 1: To access the Cron Jobs Menu, click on the corresponding icon located on the main screen of your cPanel interface.

Image Added

  • Step 2 (optional): Enter the email address where the cron output will be sent to in the corresponding field.

Image Added

  • Step 3: Enter the command "php <path_to_phpfox_root_dir>/cron.php" in the blank field next to the Command field. (<path_to_phpfox_root_dir>/cron.php

...

https://documentation.cpanel.net/display/ALD/Cron+Jobs

Setup from command line on web server via ssh

  • is the PATH we received in first step)

Image Added

  • Step 4: Select how often you wish the command to be run by selecting an option in each of the boxes or by selecting a predefined period from the Common Settings drop-down menu. We suggest to run the cron job every 5 minutes.

Image Added

  • Step 5: Click on Add New Cron Job to save your changes and set up your cron job.

    Note
    titleNote

    This instruction is just available for cPanel version 56. For other versions please visit the cPanel Cron Job Document to get more information.


Set up with command line (linux server)

  • Step 1: Log in to your web server via ssh.
  • Step 2: Enter the command below to edit the cron jobs list on your server 
Code Block
languageapplescript
$ > crontab -e

...

  • Step 3: Add the command below to the list to add the phpFox cron job. (<path_to_phpfox_root_dir>/cron.php is the PATH we received in first step). With this command, the phpFox cron job will be executed every 5 minutes.
Code Block
languageapplescript
*/5 * * * * php <path_to_phpfox_root_dir>/cron.php

...

  • Step 4: Save the change and the phpFox cron job have been set up successfully.

Set up on Window Server

Create a schedule task to execute the

...

command "php <path_to_phpfox_root_dir>/cron.php" (<path_to_phpfox_root_dir>/cron.php is the PATH we received in first step)