search

Home  >  Q&A  >  body text

node.js - Why is the entire PHP code returned when accessing PHP files under webpack, but it can be accessed normally in a normal environment.

Why is the entire PHP code returned when accessing PHP files under webpack, but it can be accessed normally in a normal environment.

< /p>

< /p>

< /p>

怪我咯怪我咯2800 days ago472

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:15:01

    Webpack is an independent server environment and does not support parsing php. Just write a json file request for simulated data, or you can run php on the Apache server to turn off cross-domain restrictions and then request again

    reply
    0
  • PHPz

    PHPz2017-05-16 13:15:01

    You opened this PHP as a file.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:15:01

    You did not set the return format

    header('content-type:application/json;charset=utf8');
    ......
    echo (json_encode(success))

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:15:01

    What "success" should be returned?
    But who is responsible for parsing php?

    reply
    0
  • Cancelreply