PHP exec怎么用

PHPz
Release: 2020-09-04 17:23:46
Original
4710 people have browsed it

PHP exec怎么用

PHP exec的使用方法:

1.exec()是php的一个禁用函数,所以我们解开

解决:

在php.ini 里面 将disable_functions = …

里面的 exec删除

2.函数的使用

exec ( string KaTeX parse error: Expected 'EOF', got '&' at position 18: …mmand [, array &̲output [, int &$return_var ]] );
Copy after login

下面来写一个简单的测试的demo 注意,要在linux环境下运行

首页创建一个test.php

<?php
exec(&#39;php hello.php&#39;,$out.$return);
var_dump($o);
?>
Copy after login

在创建一个hello.php

<?php
 echo &#39;hello world&#39;;
?>
Copy after login

执行

bf873847804fb0017a9d3cd1a9f47aa.png

更多相关知识,请访问PHP中文网

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template