当前位置:网站首页>Using exec in PHP to display errors
Using exec in PHP to display errors
2022-06-11 09:50:00 【Burn oil to follow the sundial, and live in poverty】
exec("unoconv -f pdf test.docx 2>&1",$error_array,$code);
if($code!=0)
Log::info('unoconv2 File conversion failed :'.json_encode($error));
return false;
return true;
above exec Code in exec(" Your execution 2>&1", Returned error message 【 The array format 】, Error code (0 No mistake ,1 Erroneous ))
And when $code by 1 when ,$error_array There will be an error return in , At this point we just need to print out , You can know the cause of the error .
When $code by 0 when ,$error_array Will return an empty array
2>&1 : stay linux The meaning expressed in is Redirect errors to standard output , Errors and standard output are piped to the next command
边栏推荐
- Interface, abstract class and relationship between classes
- ESP8266_GET请求天气预报、json解析
- ESP8266_通过MQTT协议连接阿里云
- 【clickhouse专栏】新建库角色用户初始化
- Suffix Array
- Project lifecycle
- 基于SSM+Vue+OSS的“依伴汉服”商城设计与开发(含源码+论文+ppt+数据库)
- Ecological co construction | 2021 streamnational excellent partner of the year comes out!
- 赛灵思引脚约束文件 .xdc
- P1169 "chessboard making"
猜你喜欢

Oracle 11g RAC disk group has space and cannot add data files?

Product list display

An error can't locate env pm in @INC

Ora-00059 exceeds DB_ Files limit

Concurrent programming

ESP8266_SNTP(Simple Network Time Protocol)

【ROS】noedic-moveit安装与UR5模型导入

About prototype and prototype chain

Technical practice of dolphin dispatching in kubernetes system

Integer lifting example
随机推荐
Set up redis highly available cluster environment
Set MySQL as externally connectable
Simple recommendation based on Euclidean distance
ESP8266_MQTT协议
P4147 "jade toad Palace"
Mysql比较
MySQL:Got a packet bigger than ‘max_ allowed_ packet‘ bytes
The first TOF related data set available for deep learning: deep learning for confidence information in stereo and TOF data fusion (iccv 2017)
《1.图书馆里系统》
How to determine whether two time periods overlap?
JS foundation -- about DOM
[ROS] noedic moveit installation and UR5 model import
ESP8266_ SmartConfig
Tap and longtap encapsulation of touch events -- from Ono
Oracle DG physical standby database uses alias data file to change path to OMF path
Opencv image basic operation (IV) -- image feature extraction (corner detection)
Flask (II) - route
Day44 database
Ora-00059 exceeds DB_ Files limit
Interview questions: REM layout, flex layout, etc