September 17th, 2011, 03:04 AM
Call php file from coldfusion file
Is it possible to call php files or functions from coldfusion file.
Kindly send me a sample code and explain.
Thanks and Regards,
September 17th, 2011, 10:50 AM
This is really a Coldfusion question rather than a PHP question.
You can call a PHP file in two ways:
1) via the command line shell using the PHP binary
2) by issuing an HTTP request to a server hosting the PHP file
I assume that Coldfusion has the capabilities to do either, however since I don't know Coldfusion I can't tell you how.
I will move this thread to the Coldfusion board for you.
September 17th, 2011, 02:26 PM
You can execute command line commands with CFEXECUTE, and you can make HTTP calls with CFHTTP. That said, I have never tried to run a PHP function from the command line via CF, so I can't really offer any specifics on how to do that.
September 17th, 2011, 07:44 PM
A PHP file can be executed from the command line in the following fashion:
Depending on your system configuration, you might need to specify the full path to the PHP binary. You might also need to use a -f flag before specifying the path to the file.