dtf54486 2013-10-15 21:38
浏览 32
已采纳

php - 创建PHP源代码不可读

I have a PHP web application, I want to make code unreadable. I have googled and the way I got is obfuscate. But the thing I want to know that making it unreadable will create any performance problem? If yes than is there is any way to make the code unreadable without affecting the performance?

Thanks

  • 写回答

2条回答 默认 最新

  • duanche4578 2013-10-15 21:45
    关注

    The first question is, why would you want to do that? A PHP application is usually hosted on a server that belongs to you and you should protect your files against the outside world via proper configuration of your server and against local users via proper permissions.

    Your question regarding obfuscation and performance is hard to answer, because we don't know how the obfuscation looks like. If it's something like base64 encoding everything and then running things through eval(), well yeah, that will definitely result in a performance hit.

    If you'd really want to make it unreadable and inaccessible use APC or OPcache. Set the TTL to 0 and delete all files. Your website is delivered only from the cached files. Of course as soon as you restart PHP/APC/OPcache/the server you'd have to upload everything again, execute each script to fill the cache again and delete everything.

    You could also use some program that morphs your PHP to C++ code and compiles it. But you'd have the same situation as with the cache idea.

    No matter what you do, you are definitely doing something wrong. Source code is not meant to be unreadable (beside JavaScript, but that's always a different story). On the contrary, it should be well designed, good documented and easily readable.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大