-2

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...

Community
  • 1
  • 1
sfaust
  • 2,089
  • 28
  • 54
  • Possible duplicate of [Reference - What does this error mean in PHP?](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – Jonathan Apr 12 '17 at 05:07
  • Ok I realized dumb mistake on my part but why the down votes? I looked around quite a bit and found several things about the PHP version as mentioned but as far as I saw I had my PHP version set correctly... – sfaust Apr 12 '17 at 05:31
  • down votes because of this `PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in **path removed**\AWS\Aws\functions.php on line 36`, same reason why I also marked as a duplicate. – Jonathan Apr 12 '17 at 05:32
  • I'm sorry I don't understand why that's a downvote? I know it points to the location but the location doesn't really tell me much since it's in the AWS SDK. Like I said I did search and find plenty of references to that error here and on Google and they did end up pointing to the PHP version but my confusion was that as far as I could see my PHP version was correct... Anyway thanks for taking the time to explain. – sfaust Apr 12 '17 at 06:51

1 Answers1

0

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.

sfaust
  • 2,089
  • 28
  • 54