I have the following entries in my crontab:
SHELL="/bin/bash"
* * * * * /home/peepzcoz/public_html/testapp/bin/cake ClientReminder
* * * * * /home/peepzcoz/public_html/testapp/bin/cake StaffReminder
* * * * * /home/peepzcoz/public_html/testapp/bin/cake ProcessJobRequests
All of these email the result to a mailbox. But for all of them I receive the following message:
Status: 500 Internal Server Error
X-Powered-By: PHP/7.2.8
Content-type: text/html; charset=UTF-8
Debug is switched on in my app.php
config file.
If I change the crontab like so:
SHELL="/bin/bash"
* * * * * /usr/local/bin/php /home/peepzcoz/public_html/testapp/bin/cake ClientReminder
* * * * * /usr/local/bin/php /home/peepzcoz/public_html/testapp/bin/cake StaffReminder
* * * * * /usr/local/bin/php /home/peepzcoz/public_html/testapp/bin/cake ProcessJobRequests
I get this result:
################################################################################
#
# Cake is a shell script for invoking CakePHP shell commands
#
# CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
# @link https://cakephp.org CakePHP(tm) Project
# @since 1.2.0
# @license https://opensource.org/licenses/mit-license.php MIT License
#
################################################################################
# Canonicalize by following every symlink of the given name recursively
canonicalize() {
NAME="$1"
if [ -f "$NAME" ]
then
DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
fi
while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME")
SYM=$(readlink "$NAME")
NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
done
echo "$NAME"
}
CONSOLE=$(dirname -- "$(canonicalize "$0")")
APP=$(dirname "$CONSOLE")
if [ $(basename $0) != 'cake' ]
then
exec php "$CONSOLE"/cake.php $(basename $0) "$@"
else
exec php "$CONSOLE"/cake.php "$@"
fi
exit
If I run it directly in the terminal, it executes fine and all of them do what they are supposed to.
How can I get debug output so that I atleast know what the issue is? I can’t see error logs on this server and the error logs in the cake logs folder is empty.
What else can I check?