当前位置:网站首页>PHP system function
PHP system function
2022-06-29 02:27:00 【hello php】
PHP The code is as follows :
<?php
$v = system('netstat -tnlp',$shell_return);
var_dump($shell_return);
var_dump($v);
Execution results :
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 7311/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6987/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 6978/cupsd
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 16181/sshd: [email protected]
tcp6 0 0 :::3306 :::* LISTEN 7361/mysqld
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::8080 :::* LISTEN 7689/httpd
tcp6 0 0 :::80 :::* LISTEN 7689/httpd
tcp6 0 0 :::22 :::* LISTEN 6987/sshd
tcp6 0 0 ::1:631 :::* LISTEN 6978/cupsd
tcp6 0 0 ::1:6011 :::* LISTEN 16181/sshd: [email protected]
tcp6 0 0 :::8000 :::* LISTEN 7689/httpd
int(0)
string(90) "tcp6 0 0 :::8000 :::* LISTEN 7689/httpd"
The conclusion is as follows :
system($shell, $shell_return):
- $shell: yes shell command , Such as 'netstat -tnlp'
- $shell_return: shell Return result of command execution , If the command is executed successfully, return 0, Otherwise, no 0
- After the function is executed , Print the result of command execution directly in the terminal window
- The return value of the function is the last line of the execution result of the command
边栏推荐
- 【Redis】Key的层级结构
- [untitled]
- Examen final de troisième année
- Set set
- Has Moore's law come to an end?
- Regular expression (?: pattern)
- Prepare for the Blue Bridge Cup - double pointer, BFS
- Finally got the byte offer. The 25-year-old inexperienced experience in software testing is written to you who are still confused
- Understanding and design of high concurrency
- QT basics tutorial: qstringlist
猜你喜欢

The 10 most commonly used gadgets for waterfall project management can be built and used freely
![[untitled]](/img/36/2f9319e05157ab6a8dd5aa3bef4505.png)
[untitled]

Koa quick start

对补wasm环境的一些测试

CTFHub-Web-密码口令-弱口令

【Redis】初识 Redis

China's flexible employment has reached 200million

Use photoshop2022 to create a wonderful gradient effect for pictures

高并发的理解与设计方案

Finally got the byte offer. The 25-year-old inexperienced experience in software testing is written to you who are still confused
随机推荐
Differences between web testing and app testing
mark
Understanding and design of high concurrency
centos7 安装php7.2
"The first share of endoscope" broke into IPO two times. Last year, it lost 500million yuan. The commercialization of core products is still in doubt | IPO Express
SystemVerilog structure (I)
指南针手机股票开户哪个券商更安全更方便?
Use code binding DataGridView control to display tables in program interface
【Redis】Set类型
Qt基础教程:QStringList
Which securities company is the largest and safest? Which securities company has good service
跨境资讯站
[untitled]
String segment combination
Download and installation of MySQL
Matrix eigenvalue and eigenvector solution - eigenvalue decomposition (EVD)
To apply for a test engineer after years, the resume with high scores should be written like this
Target detection - ADAS practice
Chrome browser close update Popup
[sans titre]