Home>Article>Backend Development> How to open php file? How to run php file?

How to open php file? How to run php file?

怪我咯
怪我咯 Original
2018-05-14 14:12:41 118279browse

How to run php: First download and install the "phpstudy" software; then copy the php file to the www directory under the installation directory; then enter the link in the browser as "http://127.0.0.1 /php file"; finally check the running results through the browser.

How to open php file? How to run php file?

Many friends have asked us recently, what isphp? What is a php file? How to open php files and other issues, here is some information compiled by php Chinese website for everyone.

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 executed on the server side. The style of the language is similar to C language and is widely used.php is what everyone on the Internet often calls the backend, which is used to process databases, etc. Many websites are written in php, including www.baidu.com, m.sbmmt.com and other websites, which are all written in php language. . Our articles are uploaded to the server database throughphp 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 after php is executed. For example, when we open the test.php code because the encoding is in gbk or utf8 format, when we use Notepad to open the php file in utf8 format, garbled characters appear when there are Chinese characters, so we recommend using notepad or editplus to support utf8. Format file software to open. (Ordinary users can choose notepad to open it, because notepad is relatively small
)A piece of php test code

The code is as follows:

'; } ?>

Related recommendations: "

What file is php? how to open? Four ways to open php format files (picture)


But everyone’s purpose is often not to see such code. If you want to see the effect after execution, you need to configure the php running environment .

m.sbmmt.com
that you visit is a pre-configured PHP operating environment on the server side. It may be Linux or Windows. When purchasing space, please ask the IDC provider and ask them. Does it support PHP? 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 phpstudy (phpstudy is relatively simple to install and use. After installation, copy the php file to the www directory under the installation directory and enter it in the browser http://127.0.0.1/php file is enough. If you select a port, you need to add the port (http://127.0.0.1: port number)

If you have set up a php running environment, go to the browser. Enter the URL in , and you can see the running effect of php (Note: the URL entered by everyone in the browser may be different, ours is the intranet IP)

As shown in the figure below:

How to open php file? How to run php file?Many friends who have no foundation 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 and requires PHP to run. The file can be accessed and opened only in the environment. If you only need to edit PHP to open the file, you only need to use Notepad or a related editor such as (DW, phpstorm, notepad++, etc.) to open and edit it (you can go to

PHP Download Station#. ##Download more development tools)

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. , is a scripting language that is executed on the server side and embedded in HTML documents. The language style is similar to C language and is widely used. Another meaning of PHP is: the standard symbol of Philippine Peso

. When learning website construction, the language I came into contact with most at the beginning was definitely HTML, and the dynamic language was definitely ASP. But with the development of the Internet and the change in the direction of hosting, especially overseas hosts are still LINUX systems, and WIN systems are very popular. It is rare and very expensive. So we are forced to choose LINUX host and use PHP language program. Some friends asked how to open the PHP language website. This question is actually very simple. No matter what language the web page is used, we can use DW or Open EDITPLUS or Notepad.

But debugging PHP programs is not as simple as ASP. We can debug or install the local environment directly in the PHP space. The PHPNOW or WAMPSERVER I am using now are good tools. #

The above is the detailed content of How to open php file? How to run php file?. For more information, please follow other related articles on the PHP Chinese website!

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