rajnaveen Posted April 20, 2017 Share Posted April 20, 2017 Hi Guys, I have an function in php in the format of in-built source code file of that function in c language.So now what i do is that on compile the c file i got an executable file using those executable file in c.I want to run the php function to get the output in php.For clarification Example:One of the function in php -> crypt( )I have an source code of that crypt( ) function which is built in c language.I do some of the modification in that in-built code which is in c language.After that now i compile the in-built code and got an executable file in c.By using this executable file i want to run the crypt() function in php compiler and want the output in php. Quote Link to comment https://forums.phpfreaks.com/topic/303755-c-compiler-to-php-compiler/ Share on other sites More sharing options...
requinix Posted April 20, 2017 Share Posted April 20, 2017 There is no good way to do this. What do you really want to do? Quote Link to comment https://forums.phpfreaks.com/topic/303755-c-compiler-to-php-compiler/#findComment-1545657 Share on other sites More sharing options...
rajnaveen Posted April 20, 2017 Author Share Posted April 20, 2017 The function in php can be built using the c language. Then how the code in c language can be executed in the php function. Quote Link to comment https://forums.phpfreaks.com/topic/303755-c-compiler-to-php-compiler/#findComment-1545662 Share on other sites More sharing options...
requinix Posted April 20, 2017 Share Posted April 20, 2017 Are you trying to execute C from PHP or PHP from C? Quote Link to comment https://forums.phpfreaks.com/topic/303755-c-compiler-to-php-compiler/#findComment-1545673 Share on other sites More sharing options...
kicken Posted April 20, 2017 Share Posted April 20, 2017 If you want to run some C function code from PHP then you basically have two options: 1) Implement a PHP Extension in C so you can expose the function to your scripts or 2) Build an executable that you can run and use functions like exec or proc_open to execute it with your input then capture the output. What kind of changes are you wanting to make to the standard crypt() function and why? 1 Quote Link to comment https://forums.phpfreaks.com/topic/303755-c-compiler-to-php-compiler/#findComment-1545715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.