View Single Post
  #58  
Old 02-21-2013, 01:44 AM
 
kevinrm kevinrm is offline
 

X-Wizard
  
Join Date: Aug 2003
Posts: 1,003
 

Default Re: xpayments Cron help please

You have to know exactly where PHP CLI is located or it won't work. Exactly, and they're not all the same.

1) Find out where your PHP CLI is. SSH into your root. If you don't have root access, you'll have to get your hosting company to do it. Once you ssh into root, run this command:

whereis php5

For my server, this was the result:

/usr/bin/php5

Knowing this is everything.

2) Run PHP scripts from Linux command line in this manner:

/user/bin/php5 /path/to/your/script.php

For me that would equate to:

/usr/bin/php5 /home/mypath/public_html/xpayments/cron.php

3) Following X-Cart instruction manual, cron is this:

0 0 * * * cd /home/mypath/public_html/xpayments ; /usr/bin/php5 -f /home/mypath/public_html/xpayments/cron.php

See the ";" between the statements? The first part tells the cron to change directories to where the file is located. The second command instructs it to run that file from the PHP CLI mode.

Took me forever to figure that out!
__________________
X-Cart 5.4.1.39 Live
PHP 7.4.33
5.5.5-10.3.38-MariaDB MariaDB
Apache 2.4
CENTOS 7.8 64Bit Single Quad-Core E3-1241v3 3.4Ghz 8M 1600 w/ HT
32GB RAM 2x 512GB Samsung 850 Pro SSD RAID 1
Reply With Quote