Cron issue with config.php [SOLVED]

Hi guys,
just installed phpList on one linux server few days ago and everything seems to work fine untill now.

At the moment cron is not able to handle -pprocessqueue (and -pprocessbounces).
To test it, I run phplist command:
sudo ./phplist.sh -pprocessqueue
and I get this error:
./phplist.sh: line 3: /var/ssl/lists/config/config.php: Permission denied

I chown root:root or www-data:www-data the file config.php but I still get the same error.
File permission is 644

Any idea ?
Thanks
edoardo

1 Like

the “Permission denied” is the issue.

You need to figure out what apache runs as, and ‘who’ is running the command line. add a line in the config.php so that it is allowed to submit commands from the command line:

# if you use commandline, you will need to identify the users who are allowed to run
# the script. See README.commandline for more info
$commandline_users = array("admin");
# or you can use the following to disable the check (take off the # in front of the line)

In the array(); put the user that is executing the command on the command line.

Thank you Dan for your reply.
Sorry, I should have read and read and read carefully ALL the config_extended.php …

I copied / pasted that section, disabled the check for the moment, but I still get that “access denied” error

Hi,

Some clarification…

  1. I just updated the info in the gray box… there should only be one $commandline_users line.
    In my example, the user “admin” is the only person that can run scripts from the command line.

  2. You need to change the word “admin” to the user(s) that will be running the cron script from the command line. You will need to figure out what usernames they are.

  3. The above needs to be in the config.php file.

Let me know how that works out…

Dan

Hi Dan,
yes, I used only one sentence. actually I’m using

$commandline_users = array();

whis is supposed to disable the check and allow evryone, isn’t it ?

I also checked using

$commandline_users = array("root");

or

$commandline_users = array("myusername");

(although using sudo) with no luck

Can you show the contents of the phplist.sh file, to see what you are actually executing?

sure !
here it is

#!/bin/bash
/usr/bin/php /var/ssl/lists/admin/index.php -c
/var/ssl/lists/config/config.php $*

Is the file really three lines? You seem to have split the phpcommand onto two lines, it should be one line:

/usr/bin/php /var/ssl/lists/admin/index.php -c /var/ssl/lists/config/config.php $*
1 Like

ahahah !! :grinning:

yes, it works now !!
I just copied it from the manual pdf …

thanks a lot,
SOLVED

1 Like