Home  >  Q&A  >  body text

I can see the phpinfo() information through http://localhost, but if I want to open it directly through the browser, the source code will be displayed.


放牛般的春天放牛般的春天2540 days ago1673

reply all(3)I'll reply

  • 枫铖

    枫铖2017-11-30 16:50:06

    The path cannot be written like this in the environment 127.0.0.1 or localhost

    reply
    1
  • PHP中文网

    PHP中文网2017-11-29 15:25:49

    Accessing the file directly through the browser will be treated as a text document, so the content of PHP will be displayed directly.

    When accessed through the domain name, the result will be the content parsed by the PHP environment

    reply
    0
  • 浮夸

    浮夸2017-11-29 14:40:50

    PHP code must be implemented through the server. HTML can be opened directly like you do. PHP must be opened locally by entering localhost or 127.0.0.1 and the path/file name.

    reply
    1
  • Cancelreply