#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Posts
    95
    Rep Power
    0

    Call php file from coldfusion file


    Dear Friends,

    Is it possible to call php files or functions from coldfusion file.
    Kindly send me a sample code and explain.

    Thanks and Regards,
    Santhosh
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    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.
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    A PHP file can be executed from the command line in the following fashion:
    Code:
    php /path/to/file.php
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo