Command for Piping Email to PHP Script

Avatar
  • updated
  • Answered
I have tried all sorts of command entries for piping email to my php script but it does not appear to be calling it.  The script and the folder have the necessary permissions for execution and I have tried the following commands with no success.  What am I doing wrong?

!#/usr/bin/php -q /home/readya9/cad-smtp/process-email.php
/home/readya9/cad-smtp/process-email.php
#!/usr/local/bin/php -q /home/readya9/cad-smtp/process-email.php

Obviously the path are not accurate for the PHP CLI but I cannot find anywhere online what this path should be on my shared in-motion server.

Pinned replies
Avatar
Alyssa K
  • Answer

Hello Anonymous, 

My apologies, as the previous response was not accurate. The PHP CLI can be accessed if you first create a php.ini file. Please see the following guide for more information on this process:

https://www.inmotionhosting.com/support/website/command-line-settings/

I apologize for any confusion regarding this. 

Best Regards, 
Alyssa K.

Avatar
Alyssa K
  • Answer

Hello Anonymous, 

My apologies, as the previous response was not accurate. The PHP CLI can be accessed if you first create a php.ini file. Please see the following guide for more information on this process:

https://www.inmotionhosting.com/support/website/command-line-settings/

I apologize for any confusion regarding this. 

Best Regards, 
Alyssa K.

Avatar
Alyssa K
  • Answered

Hello Anonymous, 

Thank you for your question. Unfortunately, it does not appear that the PHP CLI can be accessed this way on shared servers due to security concerns. If you would like to utilize PHP CLI in this way, you will likely need to upgrade to a VPS or dedicated server.

Best Regards, 
Alyssa K.