
php exec的使用方法:
1.exec()是php的一个禁用函数,所以我们解开
解决:
在php.ini 里面 将disable_functions = …
里面的 exec删除
立即学习“PHP免费学习笔记(深入)”;
2.函数的使用
exec ( string KaTeX parse error: Expected 'EOF', got '&' at position 18: …mmand [, array &̲output [, int &$return_var ]] );
下面来写一个简单的测试的demo 注意,要在linux环境下运行
首页创建一个test.php
<?php
exec('php hello.php',$out.$return);
var_dump($o);
?>在创建一个hello.php
<?php echo 'hello world'; ?>
执行

更多相关知识,请访问PHP中文网!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号