How can the PHP file be opened? _php Tutorial

Source: Internet
Author: User
Tags configuration php sapi

How can the PHP file be opened?


How can the PHP file be opened? PHP simple hypertext Preprocessor Chinese name is hypertext preprocessor, it and c,c++,java,perl as can do some algorithm operation, while PHP is mainly used in Web application development, PHP entry threshold is lower, Easy to learn, widely used, mainly for the field of web development. PHP has a file suffix called PHP.

  What is a php file?

How can the PHP file be opened? PHP simple hypertext Preprocessor Chinese name is hypertext preprocessor, it and c,c++,java,perl as can do some algorithm operation, while PHP is mainly used in Web application development, PHP entry threshold is lower, Easy to learn, widely used, mainly for the field of web development. PHP has a file suffix called PHP.

  How can the PHP file be opened?

PHP File Open method is very simple we can directly use the Notepad text can be played, if it is a Web development application we can use DW Notepad + + Eclipse PDT Notepad2 and so on can be opened, this open can only view the source files cannot be executed.

  How PHP files work

The previous introduction of PHP is a web development field of a programming language, we need the support of the PHP environment to run OH.

The PHP environment has those

PHP can run in Windows or Linux, support environment in Windows iis+php or apache+php environment

I can also use the apache+php or nginx+php environment in Linux

  How the PHP environment is configured

  Iis+php Environment Configuration method

1> extract to the c:/php directory.

Open the c:/php directory and locate the Php.ini-dist file. Rename to PHP.ini.

2> open a php.ini file.

to find; include_path = ".; C:/php/includes "the line.

Modified to include_path = "C:/php/includes"

Find Extension_dir = "./"

Modified to Extension_dir = "C:/php/ext"

to find; Extension=php_mysql.dll.

Modify to Extension=php_mysql.dll

Found; Session.save_path = "/tmp"

Modified to Session.save_path = "C:/winnt/temp"

"C:/windows/temp" If the operating system is Win2003

PHP.ini available in this catalogue can be used directly. For Windows2000.

3> copy php.ini to C:/winnt

Copy Libmysql.dll to C:/winnt/system32

4> new directory d:/forphp as a test PHP site directory.

Under this directory, create a new Notepad file, and rename the index.php content to have index.php for use in this directory.

5> ensure that Iusr_mochinename users have full control of d:/forphp.

There is read run permission on the c:/php. (If the D drive is FAT32 file system format, you do not have to set d:/forphp permissions)

6> Open IIS Manager.

Create a new Web site. Point to the d:/forphp directory. The site host header is arbitrarily specified. (for easy browsing, use native IP)

7> Right-click Site-Properties--Home directory option.

Click Configure below. Popup "Application Configuration", click "Add". executable file, browse to select C:/php/php5isapi.dll OK. Extension write. php

8> re-starting IIS. You can implement PHP scripts that support the IIS site.

Settings for PHP coexistence with IIS

The first step is to untie the PHP5.0 compression pack and put it under C:/PHP5.

The second step, the c:/php5 below the php.ini-dist file copied to the Winnt directory, and renamed to PHP.ini. You do not need to modify any parameters to run, of course, depending on the situation you can modify some parameters.

The third step is to copy the C:/php5/php5ts.dll into the C:/winnt/system32 directory.

Fourth step, start the Computer Management.

Fifth, expand Services and Applications/Internet Information Services on the Computer Management window, click the right mouse button on the default Web site, select Properties, and the Default Web Site Properties window pops up:

Seventh, click on the "ISAPI filter" tab on the "Default Web Site Properties" window, tap the "Add" button, enter "PHP" in "Filter Name" in the "Filter Properties" window that pops up, "C:/php5/sapi/php5isapi.dll" in "Executable" Are you sure.

Eighth, in the "Default Web Site Properties" window, click on the "Home Directory" tab, click the "Configure" button, in the pop-up "Application Configuration" window, click the "Add" button, in the pop-up "Add/Edit Application Extension Image" dialog box in the "Executable" text box, enter "c:/php5/ Sapi/php5isapi.dll "," extension "text box, enter". PHP "(note must have that point), OK.

Nineth, open the Command Line window and enter the "net stop IISAdmin" command to terminate the IIS service. The system will ask you if you want to stop the related services, answer yes. Wait until all is closed.

Tenth step, enter the "net start w3svc" command to restart the IIS service.

  Apache Configuration PHP Environment

1. We install Apache environment in the computer,

2. Then we download the PHP version after the decompression in the C: disk PHP directory

And then we'll add it to Apache's back.

LoadModule php5_module "C:/php5/php5apache2_2.dll"

AddType application/x-httpd-php. php

Phpinidir "C:/PHP5"

And then reboot Apache so it's configured.

Then we create a Web site to put the php file in the Site directory can be run, the code is as follows

Define ("Test", "HELLO world!");

echo Test

?>

Output to

HELLO World

Friendship Tips, this article is just about the introduction of PHP is what file and PHP file open and let Php run some ideas, specifically, if you want to really run PHP we also need to be more granular to configure the Apache environment can be oh, because the real application also has the MySQL database installation configuration Oh.

http://www.bkjia.com/PHPjc/873238.html www.bkjia.com true http://www.bkjia.com/PHPjc/873238.html techarticle How can the php file be opened? PHP All-simple hypertext preprocessor Chinese name is hypertext preprocessor, it and c,c++,java,perl as can do some algorithm operation, ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.