当前位置:网站首页>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
边栏推荐
- BeanFactoryPostProcessor 与BeanPostProcessor的区别
- Day39 process object and other method mutexes
- JS foundation -- Operator
- How do online app stores of laundry chain stores do?
- 完结C语言
- About prototype and prototype chain
- RAC expdp export error: ora-31693, ora-31617, ora-19505
- P1169 "chessboard making"
- Detailed explanation of the difference between construction method and method
- ESP8266_通过MQTT协议连接阿里云
猜你喜欢

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

远程工作时代的物联网安全

Rebuilding Oracle XdB components

Concurrent programming
![[image denoising] image denoising based on mean + median + Gauss low pass + various improved wavelet transform, including Matlab source code](/img/df/9c7c9484879249a35781425e710983.jpg)
[image denoising] image denoising based on mean + median + Gauss low pass + various improved wavelet transform, including Matlab source code

LeetCode刷题 —— 手撕二叉树

How do we connect to WiFi?

MSF adds back door to normal program

Résumé de la méthode d'examen des mathématiques

ESP8266_ SNTP(Simple Network Time Protocol)
随机推荐
宜居行星
ESP8266_SmartConfig
CVE-2021-40449 NtGdiResetDC UAF
What is the difference between an interface and an abstract class?
[TiO websocket] III. The TiO websocket server can send messages to users anywhere
启动jar
LeetCode刷题 —— 手撕二叉树
MSF adds back door to normal program
Day45 storage engine data type integer floating point character type date type enumeration and set type constraints table to table relationships
Oracle 11g RAC disk group has space and cannot add data files?
document对象
ESP8266_接入百度物联网核心套件、使用MQTT协议通信
【音视频】SEI简介
JS foundation - array object
远程工作时代的物联网安全
优秀测试工程师必备的4项安全测试方法!
Flask (III) -- variable rules
Thread theory
不同CV任务的标注类型
Don't use redis list to implement message queue. Stream is designed for queues