Home  >  Q&A  >  body text

php 5.6 include php file directly outputs the file content without execution, and php5.2 will be normal.

As shown in the figure, the code for executing the file is as shown below. . . .

QQ截图20190607003718.pngAs a result, the code in dbConfig.php is output directly to the browser. No analysis at all.

输出内容.png

Copy the code in dbConfig.php to the running php file and it will be normal

正常运行的代码.png

It is estimated to be 5.6 The version has upgraded the initialization and execution restrictions of the class. What do experienced heroes do?

yoyoyoyo1936 days ago1069

reply all(1)I'll reply

  • yoyo

    yoyo2019-06-07 01:26:05

    Let me answer my own question. . hehe.

    Please take a look at the php statement of dbConfig.php. It is for short tags. This will happen if the php.ini configuration does not enable short tag support. The problem is solved after turning on short_open_tag = On. . .

    reply
    0
  • Cancelreply