Home >Backend Development >PHP Tutorial >How to open php files How to execute php files_PHP tutorial

How to open php files How to execute php files_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:22:51748browse

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 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.
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 a php file:

In a simple sentence, php is the same as a txt (text document). Notepad can open it, but what you see is the code, not the code. The effect after php is executed. For example, when we open the test.php code because 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, so we recommend using dreameweaver or editplus Wait for software that supports utf8 format files to open it. (Ordinary users can choose editplus to open it, because editplus is relatively small)

A piece of php test code

Copy code The code is as follows:

for($i=1;$i<=10;$i++){
echo $i.'
';
}
echo "www.jb51.net";
?>

But the purpose is often not to see such code, if you want to see the execution For the final effect, you need to configure the PHP running environment.
The www.jb51.net you visit is a pre-configured PHP operating environment on the server side, which 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 )
As shown in the picture below:
How to open php files How to execute php files_PHP tutorial

Many friends who have no basic knowledge often ask how to open PHP files. In fact, PHP is a web script, but it is different from the html xml tag language. It can be opened directly through the browser. You need a PHP running environment to access and open the 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 embedded in HTML documents that is executed on the server side. The language style 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 was definitely HTML, and the dynamic language was definitely ASP. However, with the development of the network and the change in the direction of hosts, especially overseas hosts, the majority are 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 good tools.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324627.htmlTechArticleWhat is php: PHP is the abbreviation of the English hypertext preprocessing language Hypertext Preprocessor. PHP is an HTML embedded language, which is an embedded HTML document executed on the server side...
Statement:
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