Moderators: Dragonrider, J_S, Hernol, vancoovur, H2B2, Heritage
Running PHPlist from the commandline
Commandline processing requires PHP 4.3.0 or higher
A few pages in the PHPlist system can now, as of version 2.7.0 be run with
a simple command from the commandline.
the script to use is called "phplist" in the "bin" directory. You will have to edit
this script to fit your system
The normal PHPlist access restrictions are bypassed, but the Unix users who are
allowed to run the script should be mentioned in the "commandline_users" config
variable. The identity of a user is determined by the USER environment variable, which
may not always match your system.
The "p" parameter is the page that needs to be run.
Currently you can use "send", "processqueue" and "processbounces"
phplist -psend
This will require some more arguments:
-l list
-s subject
[-f from]
and you need to "pipe" the message into the script.
The -l parameter can have two types of values, the name of the list or the number of the list.
You can added multiple lists or multiple -l parameters
The subject can have spaces
The from is optional. It will default to the system administrator as set up in your config.
So the full "send" command line would be:
phplist -psend -s This is the subject -l test 1 2 3 -f me@server.com < messagefilealkibsi wrote:I am requesting to utilize this thread to illustrate processing the queue and bounced mail via commandline or cron job. Step by step for users who are for the first time use cron jobs, or shell access.
#!/bin/bash
# script to run PHPlist from commandline. You may need to edit this to make it work
# with your shell environment. The following should work for Bash
# in commandline mode, access is restricted to users who are listed in the config file
# check README.commandline for more info
# identify the config file for your installation
CONFIG=/home/USER/public_html/list/config/config.php
export CONFIG
# alternatively you can use -c <path to config file> on the commandline
# run the PHPlist index file with all parameters passed to this script
/usr/bin/php /home/USER/public_html/list/admin/index.php $*
-rwxr-xr-x 1 root root 642 Jul 11 01:18 phplist*
php -vPHP 4.3.1 (cli) (built: Jul 28 2003 11:46:14)cd /sbinmv /home/admin/phplist phplistchown root phplist
chgrp root phplistchmod 775 phplistcrontab -e*/15 17-23 * * 2,3,4,5,6 /sbin/phplist -pprocessqueue
*/15 0 * * 2,3,4,5,6 /sbin/phplist -pprocessqueue
*/15 1-6 * * 2,4,6 /sbin/phplist -pprocessqueue
10 1 * * 3,5,7 /sbin/phplist -pprocessbouncesvi phplistCONFIG=/home/USER/public_html/list/config/config.php
-needs to be edited to where your config file is located.
/usr/bin/php /home/USER/public_html/list/admin/index.php $*
-again, you need to edit where your admin login is and possible where the php binary is, if it's not in the normal spot there (/usr/bin/php)phplist -pprocessqueuePHPlist version 2.8.8 (c) 2000-2004 Tincan Ltd, http://www.phplist.com
Error: Sorry, You (admin) do not have sufficient permissions to run this scriptPHPlist version 2.8.8 (c) 2000-2004 Tincan Ltd, http://www.phplist.com
Error: Sorry, You () do not have sufficient permissions to run this scriptphp -vPHP 4.3.3 (cli) (built: Jun 8 2004 19:27:04)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
Return to Advanced Questions & Problems
Users browsing this forum: No registered users and 0 guests