Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace complex PHP code with C code

Tags:

c

php

exec

I query an Oracle database using PHP but at a certain point, probably dued to the fact that the PHP code is very complex, I get a memory leak. I'm working to solve this but I ask you: if I convert all the complex PHP code to C code and I call an "exec" from PHP when needed, do I gain something in performance and memory optimization? Or is it a bad idea? And why?

like image 528
Lotus1 Avatar asked Jul 19 '26 16:07

Lotus1


1 Answers

If you want to rewrite the code in C, then you'd be better off writing it as a PHP module than as a standalone program called from PHP using exec().

like image 138
Mark Baker Avatar answered Jul 22 '26 07:07

Mark Baker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!