我无法在文本编辑器中执行PHP程序 [英] I can't execute a PHP program in my text editor

查看:88
本文介绍了我无法在文本编辑器中执行PHP程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在notepad ++中运行我的第一个php程序,但问题是它不执行PHP代码,除了.php文件中的html代码。我安装了xampp服务器,我的文件保存在我的root文件夹中文件夹htdocs,但我不知道问题,我需要帮助。



我尝试过:



i已经谷歌了,并在其他论坛提问但是解决方案了。

i am try to run my first php program in notepad++,but the problem is that it doesnot execute php code execept html code in the .php file.i have installed xampp server and my file is saved in a folder in my root folder htdocs,but i dont know the problems please i need help.

What I have tried:

i have google it out and ask question in other forum but solution yet.

推荐答案


在Xampp控制面板中确保apache启动并运行并运行mysql / mariadb。

然后导航到浏览器上的localhost以查看它是否正在运行。



如果localhost显示在xammp主页上,你可以导航到localhost / mywebsite,其中mywebsite是你在htdocs下创建的文件夹。



问候
Hi In Xampp control panel ensure that apache is started and running and mysql/mariadb.
Then navigate to localhost on your browser to see if its running.

if localhost displays the xammp homepage, you can navigate to "localhost/mywebsite" where "mywebsite" is the folder you have created under htdocs.

regards


作为一般规则,您需要将文件放在服务器的网站文件夹中。



这是,例如, WAMP / LAMP服务器中的 www 。简单来说,此文件夹中的项目被视为网站页面。如果您有上述服务器之一,P代表PHP,如果服务器正在运行,它将解析PHP并且事情将是有意义的。 IIS具有类似的位置 - 可能不包含PHP。你自己不创建这个'www'文件夹!它是在安装服务器时创建的。这是一个非常具体的地方!



这是一个特殊的地方,可以说,在你的系统上,其内容被视为网页。



也许您的示例正在开始在网络文件夹中进行编辑?即使这样,您也需要使用浏览器打开文件,以便将其显示为网页。
As a general rule, you need to put the files in your "website" folder of your server.

This is, for example, www in WAMP/LAMP servers. In simple terms, items in this folder are treated as website pages. If you have one of the aforementioned servers, the P stands for PHP and if the server is running it will parse the PHP and things will make sense. IIS has a similar location - likely won't contain PHP. You do not create this 'www' folder yourself! It's created when you install the server. It's a very specific place!

This is a special place, so to speak, on your system, whose contents are treated treated as web pages.

Perhaps your examples are doing their editing in the web folder to begin with? Even then, you'd need to open the file with a browser for the it to be displayed as a web page.


这篇关于我无法在文本编辑器中执行PHP程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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