如何在我的电脑上运行PHP文件 [英] How to run php files on my computer

查看:277
本文介绍了如何在我的电脑上运行PHP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我怎么到我的系统上本地运行的PHP文件。结果
目前我使用一台服务器运行文件。结果
我知道这两个PHP和放大器;要安装的Apache。结果
我需要看到这一计划的投放,例如:

Could anyone please tell me how to run a php file locally on my system.
Currently I am using a server to run files.
I know both php & Apache to be installed.
I need to see out put of this program, for example:

<?php 
$a=5;
$b=10;
$c=$a+$b;
print $c;
?>

你能告诉我怎么可以运行的,如果我有什么需要更多的这些文件。

Can you please tell how I can run these files of if I need anything more.

推荐答案

您必须运行一个Web服务器(例如Apache)的并浏览到本地主机,最有可能在80端口。

You have to run a web server (e.g. Apache) and browse to your localhost, mostly likely on port 80.

你真正应该做的是安装一个全功能于一身的包如 XAMPP ,它捆绑了Apache,MySQL和PHP和Perl(如果你是如此倾斜),以及与Apache和MySQL的一些其他工具 - 再加上它是跨平台(这是在'XAMPP'的'X'代表)

What you really ought to do is install an all-in-one package like XAMPP, it bundles Apache, MySQL PHP, and Perl (if you were so inclined) as well as a few other tools that work with Apache and MySQL - plus it's cross platform (that's what the 'X' in 'XAMPP' stands for).

一旦你安装XAMPP(且有一个安装程序,所以它不应该是硬)打开控制面板的XAMPP,然后点击旁边的阿帕奇开始按钮 - 注意,需要数据库的应用程序,你还需要启动MySQL(和你就可以通过phpmyadmin与它接口)。一旦你开始了Apache,你可以浏览到的http://本地主机

Once you install XAMPP (and there is an installer, so it shouldn't be hard) open up the control panel for XAMPP and then click the "Start" button next to Apache - note that on applications that require a database, you'll also need to start MySQL (and you'll be able to interface with it through phpMyAdmin). Once you've started Apache, you can browse to http://localhost.

此外,无论你是否选择XAMPP(我建议),你应该只需要启动Apache。

Again, regardless of whether or not you choose XAMPP (which I would recommend), you should just have to start Apache.

这篇关于如何在我的电脑上运行PHP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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