Shell Command Not Running in Automation

I am trying to run a php script through shell command. I have tested the php file and it runs well through the command line. Here is my code

# automations
automation:
  - alias: test
    trigger:
      platform: state
      entity_id: input_boolean.test_btn
      to: 'on'
    action:
      - service: input_boolean.turn_off
        data:
          entity_id: input_boolean.another_test
      - service: shell_command.run_php

# shell command
shell_command:
  run_php: 'php /var/www/test/test.php'

The automation runs well, other than not firing the shell command.

I have checked the home assistant log file and there are no reported errors. I have tried having the shell command with single quotes and without.

Any suggestions as to what I am doing wrong? Should I move the php file next to my configuration file? do I require some special permissions to run scripts from home assistant?

Thanks.

this is most likely a permission issue … i would first provide a complete path name to php…second check file permissions for /var/www/test/test.php and you may need to white_list dir e.g. in configuration.yaml

whitelist_external_dirs:
- ‘/tmp’

Thanks that fixed it!