I'm creating an app using CodeIgniter, but I'm unable to run Linux commands using my PHP script.
我正在使用CodeIgniter创建一个应用程序,但我无法使用我的PHP脚本运行Linux命令。
How do I run terminal commands?
如何运行终端命令?
I've tried shell_exec()
and exec()
, but both don't work while using CI.
我尝试过shell_exec()和exec(),但在使用CI时都不起作用。
1 个解决方案
#1
1
That depends on your server configuration if the functions are disabled, you need to enable them in your php.ini
. Here are some alternatives:
这取决于您的服务器配置如果禁用了这些功能,您需要在php.ini中启用它们。以下是一些替代方案:
popen()
- or if you need an interactive way try
proc_open()
system()
或者如果你需要一种交互方式,请尝试proc_open()
#1
1
That depends on your server configuration if the functions are disabled, you need to enable them in your php.ini
. Here are some alternatives:
这取决于您的服务器配置如果禁用了这些功能,您需要在php.ini中启用它们。以下是一些替代方案:
popen()
- or if you need an interactive way try
proc_open()
system()
或者如果你需要一种交互方式,请尝试proc_open()