云9&x2014;php文件被下载而不是执行

云9&x2014;php文件被下载而不是执行,php,cloud9-ide,Php,Cloud9 Ide,我正在Cloud9平台上开发一个项目,最近遇到了以下问题 html页面和php文件以.txt文件形式写入html页面上的数据: process.php <?php $name = $_GET['email']; $file = 'myText.txt'; file_put_contents($file, $name); ?> index.html form action="process.php" method="get"> <div class="label">

我正在Cloud9平台上开发一个项目,最近遇到了以下问题

html页面和php文件以.txt文件形式写入html页面上的数据:

process.php
<?php
$name = $_GET['email'];
$file = 'myText.txt';
file_put_contents($file, $name);
?>

index.html
form action="process.php" method="get">
<div class="label">email</div>
<div class="labeled">
<input type="text" name="email" class="text" >
</div>
<input type="submit" class="submit">
</form>
process.php
index.html
form action=“process.php”method=“get”>
电子邮件
我使用Cloud9Web界面运行process.php,然后单击submit按钮时,process.php将被加载而不是执行

我知道这与php设置有关,但我不确定具体是哪个。

这很可能是web服务器mime类型的问题,而不是编码问题。您是使用应用程序url访问php页面,还是使用Cloud9的预览功能?您应该始终运行apache服务器,并通过应用程序url(
http://-.c9.io
)。如果没有帮助,请告诉我。@mutahir我使用c9访问的预览功能(项目基于c9 php工作区模板)这里是指向我要在服务器上执行的php脚本的链接:预览功能只是查看文件。如果您想运行php脚本,请启动apache服务器并尝试从我前面评论中提到的url访问它。另外,请查看: