ds20021205 2015-11-08 13:57
浏览 27
已采纳

PHP文件包含问题

I have two php files on two servers. Lets call them server A and server B.

I want my php file on A to include the code in file on B.

What php directives must be enabled on both servers?

Also, when a remote file is included, will the code of the file be included or the output of the code (as in, echo data) sent to the requesting script?

  • 写回答

1条回答 默认 最新

  • duanju6788 2015-11-08 14:37
    关注

    On Server B, you should set, in your php.ini, the value of allow_url_include to On. Be wary though that there are major security repercussions with using allow_url_include so use very carefully and do a lot of due diligence before doing this.

    If you want only one directory to allow PHP files to be included by another server, then you can just create an .htaccess file with the following line:

    php_flag allow_url_include on
    

    Whatever your file structure is, then allow_url_include is a security concern (unless your server is not accessible to the outside world).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥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调用不了
  • ¥50 切换TabTip键盘的输入法