How to open php file How to open php file How to execute php file

WBOY
Release: 2016-07-29 08:47:30
Original
1127 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 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 effect of php execution. For example, we open the test.php code because of the encoding There are gbk or utf8 formats. When using Notepad to open php files in utf8 format, garbled characters will appear when there are Chinese characters. Therefore, we recommend opening them with software that supports utf8 format files such as Dreameweaver or EditPlus. (Ordinary users can choose editplus to open, because editplus is relatively small)
A piece of php test code

Copy the code The code is as follows:


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


But everyone’s purpose is often not to see this Code, if you want to see the effect after execution, 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. It may be Linux or Windows. When purchasing space, please ask the IDC provider whether they support PHP or purchase it later. If there is a space that does not support PHP, it cannot support PHP either.
If you are testing 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.0.1 in the browser. 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 entered by everyone in the browser may be different, ours is the intranet IP)
As shown in the picture below Remarks:
 php文件怎么打开 如何执行php文件
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. 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 at the beginning 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 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.

The above introduces how to open php files, how to open php files, and how to execute php files, including how to open php files. I hope it will be helpful to friends who are interested in PHP tutorials.

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