I have a simple PHP script that I created to do some basic maintenance on my DynamoDB account and I would like it to run daily. I have it set up on my host which is GoDaddy Windows based / plesk. When I go directly to the page via a browser it runs perfectly and does exactly what I want. However I set it up as a scheduled task and I get this error every time it runs:
Status: 500 Internal Server Error
Content-type: text/html
PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in **path removed**\AWS\Aws\functions.php on line 36
I have googled and have found tons of sites with this error but they all say that it was related to the PHP version being earlier than 5.5 and PHP 5.5 minimum is required. However I am running PHP 5.6, plus like I said it runs fine if I just go through a browser, it's the scheduled task that doesn't work...
I'm guessing there is something different about the way a task is pathed or run or something but I can't figure out what it is, does anyone have any insight?
Well technically the error being thrown is the 'unexpected T_VARIABLE' error referenced at Reference - What does this error mean in PHP?, that's not really the issue. That php file is inside the AWS SDK so I don't think the answer is that it's coded wrong. Also it runs on a normal page, just not in task scheduler so really the question is what am I doing wrong with task scheduler that is making it error out...
Ok I'm dumb, I knew it would be something simple. In case anyone has the same issue, the path I put for the php executable in task scheduler was the one for PHP 5.4, not 5.6. I had my hosting set for PHP 5.6 but was telling task scheduler to run PHP 5.4 hence the error. Updated the exe path and it works now.