how to know my php5 is running under suphp?
2条回答 默认 最新
- dqhnp44220 2011-04-09 02:45关注
If you don't have the POSIX extension installed (it's not common on shared hosting), one option is going to be creating a new file and then checking the
uid
/gid
it's created with:file_put_contents('./tmp.txt', 'Stuff!'); echo "File UID is: ", fileowner('./tmp.txt'), ', GID is: ', filegroup('./tmp.txt');
Now, the numbers alone might not be useful, but they can serve as guidelines.
If the UID is 99, the user PHP is running as is
nobody
, which means no suPHP. If the UID is 33, that could be userwww-data
, which again means no suPHP.If the UID is just a few over 9000 500 or 1000, then there is a small chance that you're under suPHP. If it's way over 500 or 1000, then you may well be under suPHP.
You might be able to actually read
/etc/passwd
and examine the UIDs there, but that's rude.However, your best bet might be checking
phpinfo
. suPHP might leave clues that it's running, or there might be other environment variables that you can take a peek at. For example, Apache'smod_php
can not possibly be suPHP, so if you see that PHP is running asmod_php
, you certainly aren't suPHP'd.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥20 怎么用dlib库的算法识别小麦病虫害
- ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
- ¥15 java写代码遇到问题,求帮助
- ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
- ¥15 有了解d3和topogram.js库的吗?有偿请教
- ¥100 任意维数的K均值聚类
- ¥15 stamps做sbas-insar,时序沉降图怎么画
- ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
- ¥15 关于#Java#的问题,如何解决?
- ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算