当前位置:网站首页>php 中使用exec显示报错
php 中使用exec显示报错
2022-06-11 09:32:00 【焚膏油以继晷,恒兀兀以穷年】
exec("unoconv -f pdf test.docx 2>&1",$error_array,$code);
if($code!=0)
Log::info('unoconv2文件转换失败:'.json_encode($error));
return false;
return true;
上面exec中的编码 exec(" 你的执行操作 2>&1",返回的报错信息【数组格式】,是否错误编码(0无错误,1有错误))
及当 $code 为1时,$error_array 中便会有错误返回,此时我们只需打印出来,就可知道错误原因。
当 $code 为0时,$error_array 就会返回一个空数组
2>&1 : 在linux 中表达的涵义是 将错误重定向到标准输出,错误和标准输出都通过管道传给下个命令
边栏推荐
- 一万字彻底学会堆和二叉树
- Fabric.js 動態設置字號大小
- 远程工作时代的物联网安全
- Exclusive interview - dialogue on open source Zhai Jia: excellent open source projects should be seen by more people. I am honored to participate in them
- Revisiting Self-Training for Few-Shot Learning of Language Model,EMNLP2021
- PD chip ga670-10 for OTG while charging
- Where is it safer to open an account for soda ash futures? How much does it cost to buy at least one hand?
- Identifier keyword literal data type base conversion character encoding variable data type explanation operator
- js基础--运算符
- 考研数学 【数列极限证明题】题型方法总结
猜你喜欢

Day41 process pool and thread pool

Comparison and introduction of OpenCV oak cameras

Day39 process object and other method mutexes

Opencv image basic operation (IV) -- image feature extraction (corner detection)

Type-C Bluetooth speaker single port rechargeable OTG solution
![[ROS] noedic moveit installation and UR5 model import](/img/bc/865c752021a4ee68e963c09f5f632d.png)
[ROS] noedic moveit installation and UR5 model import

ESP8266_SmartConfig

oracle 11g rac 磁盘组有空间无法增加数据文件?

Flask (VIII) - form processing

DOS command virtual environment
随机推荐
document对象
Identifier keyword literal data type base conversion character encoding variable data type explanation operator
什么是数字孪生?一个实时而虚拟的表现形式
Flask (III) -- variable rules
Day45 storage engine data type integer floating point character type date type enumeration and set type constraints table to table relationships
Where is it safer to open an account for soda ash futures? How much can soda ash futures do now?
ESP8266_SNTP(Simple Network Time Protocol)
整型提升例题
关于原型及原型链
等待事件 enq: KO - fast object checkpoint可行的一些处理方法
Package details
Opencv oak-d-w wide angle camera test
Telecommuting best practices and Strategies
How do we connect to WiFi?
Flask (II) - route
Inductive bias的一些理解
ESP8266_通过MQTT协议连接阿里云
Modularnotfounderror: no module named 'find_ version’
赛灵思引脚约束文件 .xdc
Touch事件的tap,longtap封装--来自小野