How to open php file How to execute php file

高洛峰
Release: 2023-03-04 16:20:01
Original
2325 people have browsed it

What is php:

PHP is the abbreviation of the English hypertext preprocessing language Hypertext Preprocessor. PHP is an HTML embedded language. It is a scripting language embedded in HTML documents that is executed on the server side. The language style is similar to C language and is widely used.
php is what everyone often calls the backend on the Internet, used to process databases, etc. Many websites are written in php, including www.baidu.com, www.jb51.net and other websites, which are all written in php language. . Our articles are uploaded to the server database through PHP code, and then statically generated through PHP code.

How to open php file:

In a simple sentence, php is the same as txt (text document). Notepad can open it, but what you see is the code, not the effect of php execution. For example, when we open the test.php code, the encoding is in gbk or utf8 format. When using Notepad to open the php file in utf8 format, garbled characters appear when there are Chinese characters. Therefore, we recommend using Dreameweaver or Editplus that supports utf8 format files. The software opens. (Ordinary users can choose editplus to open it, because editplus is relatively small)

A piece of php test code

<?php 
for($i=1;$i<=10;$i++){ 
echo $i.&#39;<br />&#39;; 
} 
echo "www.php.cn"; 
?>
Copy after login

But everyone’s purpose is often not to see such code. If you want to see the execution of As a result, you need to configure the PHP operating environment.
The www.php.cn you visit is a PHP running environment configured in advance on the server side. It may be Linux or Windows. When purchasing space, please ask the IDC provider if they support PHP. Otherwise, If you purchase a space that does not support PHP in the future, it will not be able to support PHP.

If you are testing the php code locally, you can use some tools such as phpnow (phpnow is relatively simple to install and use. After installation, copy the php file to the htdocs directory and enter http://127.0 in the browser .0.1 is enough. If you select a port, you need to add the port http://127.0.0.1: port number). IIS can also be used, but it requires a slightly more professional person to configure it. Here we also provide you with the iis php operating environment. The premise is that your computer has iis, which is generally not installed on personal computers by default. The operating systems that support iis are generally winxp and win2003 systems.

If you have set up the php operating environment and enter the URL in the browser, you can see the running effect of php (note: the URL you enter in the browser may be different, ours is the intranet IP )
Many friends who have no foundation often ask how to open PHP files. In fact, PHP is a web script, but unlike the HTML xml tag language, it can be opened directly through the browser. A PHP running environment is required to access and open it. File, if you only need to edit PHP to open the file, you only need to use Notepad or a related editor such as (DW, EclipsePHP, editplus, etc.) to open and edit it.

Let’s introduce what PHP is and add some basic knowledge of PHP. PHP is the abbreviation of the English hypertext preprocessing language Hypertext Preprocessor. PHP is an HTML embedded language. It is a scripting language that is embedded in HTML documents and is executed on the server side. The style of the language is similar to C language and is widely used. Another meaning of PHP is: The standard symbol for the Philippine peso.

When we were learning website construction, the language we came into contact with most in the early stage must be HTML, and the dynamic language must be ASP. However, with the development of the network and the change in the direction of hosts, especially overseas hosts have more LINUX systems, while WIN systems are rare and very expensive. Therefore, we are forced to choose LINUX host and use PHP language program. Some friends asked how to open a website in PHP language. This problem is actually very simple. No matter what language the web page is in, we can open it with DW or EDITPLUS or Notepad.
But debugging PHP programs is not as simple as ASP. We can debug directly in the PHP space or install the local environment. The PHPNOW or WAMPSERVER I am using now are both good tools.

For more articles on how to open php files and how to execute php files, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!