当前位置:网站首页>Exec function of PHP
Exec function of PHP
2022-06-10 22:05:00 【Sleepy snail】
One 、 Modify the configuration file
Create a new one php file
<?php
$command = "pwd"; //ls yes linux Directory under , The order of the document
exec($command,$array); // Carry out orders
print_r($array);
?>
Enter the command to execute
php ./test.phpException found

This is because in the php Is prohibited in the configuration file of exec Function operation , Therefore, you need to modify the configuration file , Use the following code to locate the configuration file
php -i|grep ini
Go to configuration file , take exec Function delete
restart php-fpm
service php-fpm restartThen it is found that it can work normally

Two 、exec function
exec ( string $command [, array &$output [, int &$return_var ]] );exec There are three parameters , The second and third parameters are not required .
The first parameter is the command to execute , The second parameter stores the output of the command execution , The third parameter returns the execution status .
边栏推荐
- As a programmer, is it really that important for the underlying principles?
- 你的公司会选择开发数据中台吗?
- 1、 Vulkan develops theoretical fundamentals
- [qingniaochangping campus of Peking University] the coordinated development of vocational education and general education, will this year's high school entrance examination be easy?
- Abbexa low sample size chicken lysozyme C (Lyz) ELISA Kit
- Interview Essentials - basic knowledge of synchronized underlying principles
- 软件测试工程师是做什么的?
- 详解MATLAB中与矩阵运算有关的算术运算符(加、减、乘、除、点乘、点除、乘方)
- Understanding of related concepts of target detection
- protoc protoc-gen-go protobuf 之间的关系
猜你喜欢

「运维有小邓」自助帐户解锁工具

ThinkPHP v6.0. X deserialization vulnerability recurrence

在模仿学习中进步的智能机器人

Which city should I go to after I graduate from it? Which position has a high salary? Which companies have good treatment?

Install MySQL on Linux system. Problems encountered in xshell

学IT毕业后该去哪个城市?哪个岗位薪资高?哪些公司待遇好?

NFT版权/版税

Intelligent robot making progress in imitation learning

初中毕业生,选择中职学校也可以升入高等学府

C language ---9 first knowledge of macros and pointers
随机推荐
Self made table
Which city should I go to after I graduate from it? Which position has a high salary? Which companies have good treatment?
Detailed explanation of MySQL range query optimization scenario instances
C language -- 1 c language cognition
【北大青鸟昌平校区】职教与普教协调发展,今年的中考会容易吗?
"O & M youxiaodeng" self service account unlocking tool
Codeforces Round #798 (Div. 2)
How to view the occupied space of a table in MySQL database
[nk] Niuke monthly competition 51 f-average question
学IT毕业后该去哪个城市?哪个岗位薪资高?哪些公司待遇好?
Mysql之將查詢結果插入到其它錶中
[nk] 牛客月赛51 F-平均题
软件测试工程师是做什么的?
[nk] 牛客月赛51 G计算题
详解MATLAB中与矩阵运算有关的算术运算符(加、减、乘、除、点乘、点除、乘方)
C language learning review -- 1 basic knowledge review
C language -- 10 first knowledge of structure
Calculus review 1
目标检测相关概念的理解
Notes to entry: do I need to know programming for O & M?