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条)

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了