Reputation:
I made a PHP library that uses proc_open
and relies on external application to process data.
Now, I need to make a "check" file that will analyze the server and return if my library can be used on it.
I figured these steps are enough:
How do I check if proc_open is allowed? Also, I guess proc_open works on windows-based servers too (just using windows command prompt instead of terminal)?
Upvotes: 2
Views: 3584
Reputation: 324760
if( function_exists("proc_open"))
would be a good start. Then use a try..catch
block to attempt to call a simple proc_open
test. If the test passes, then proc_open
is allowed.
As for the external application, if it defines any functions you can use function_exists
to check and see if it is installed and working.
Upvotes: 2