博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mac php-frm xampp_如何在Mac中使用shell_exec xampp php
阅读量:4578 次
发布时间:2019-06-08

本文共 955 字,大约阅读时间需要 3 分钟。

I just cant figure it out how can execute shell commands on php. it must suppose to echo the parameters of mogrify but it always return false. How could i do it on a macbook pro yosemite? i already tried editing all users permissions to read/write/execute but still no luck.. already tried researching the web about this and cant get the answer.

my code is:

echo shell_exec("/opt/ImageMagick/bin/mogrify");

?>

解决方案

OK for all of you to solve this kind of problem that any terminal application don't run on mac and returns null in any kind of calling terminal apps like shell_exec, exec, system etc. this is the one of a kind that took me 24 hours to know.. it's about the working dir.

// The Code that took me 24 Hours to Discover.

exec('unset DYLD_LIBRARY_PATH ;');

putenv('DYLD_LIBRARY_PATH');

putenv('DYLD_LIBRARY_PATH=/usr/bin');

$voila = shell_exec("anything you want to execute!");

var_dump($voila);

with that work around your problem will be fixed.

转载地址:http://poqms.baihongyu.com/

你可能感兴趣的文章
次短路——Dijkstra
查看>>
Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms
查看>>
Form属性、内置子程序、触发器、系统变量
查看>>
广州夜景一
查看>>
linux编译安装python3和安装django
查看>>
PHP数组对象互转
查看>>
JVM(2)--一文读懂垃圾回收
查看>>
iOS ERROR: unable to get the receiver data from the DB 解决方式
查看>>
游戏开发——战斗系统设计技巧
查看>>
Android ROM 制作教程
查看>>
Android模拟器使用SD卡
查看>>
新手Oracle安装及使用入门
查看>>
帝国cms灵动标签下常用标签
查看>>
STL学习笔记(关联式容器)
查看>>
Android生成xml
查看>>
python入到到实战--第十章----文件
查看>>
FMDataBase 打开sqlite的外键约束功能
查看>>
Nmap 7.70新增功能——扫描主机所有IP
查看>>
二分图
查看>>
UVA10559&POJ1390 Blocks 区间DP
查看>>