HTTP响应是整个PHP文件 [英] HTTP response is entire PHP file

查看:187
本文介绍了HTTP响应是整个PHP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的离子应用程序中,我有一个$ http.post(),它将用户信息发送到我的PHP文件。然后,PHP文件调用proc将信息存储在MySQL中并回应成功。然而,我看到的问题是当我将响应记录到控制台时,整个PHP文件被打印而不是1/0,从成功开始。我发现它不是运行PHP文件,而是打印到日志中。有没有办法来解决这个问题?

In my ionic app I have an $http.post() that sends user information to my PHP file. The PHP file then calls a proc to store the information in MySQL and echos the success. The problem I'm seeing however is when I log the response to the console, the entire PHP file is printed instead of 1/0, from success. I found that instead of running the PHP file, it just seems to be printed to the log. Is there a way to fix this?

推荐答案

您需要在服务器上设置 .php 的处理程序。

You need to setup the handler for .php on the server.

在.htaccess或httpd.conf中添加此处理程序。

In your .htaccess or httpd.conf add this handler.

AddHandler application/x-httpd-php5 .php

这篇关于HTTP响应是整个PHP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆