How does the php file open?

Source: Internet
Author: User
Tags configuration php file system iis ini php file sapi mysql database

How does the php file open? PHP full Jane hypertext Preprocessor Chinese name is a hypertext preprocessor, it and C,c++,java,perl can do some algorithmic operations, while PHP is mainly used in Web application development, PHP entry threshold is lower, Easy to learn, widely used, mainly applicable to the field of web development. PHP's file suffix is named PHP.

  What file is the php file?

How does the php file open? PHP full Jane hypertext Preprocessor Chinese name is a hypertext preprocessor, it and C,c++,java,perl can do some algorithmic operations, while PHP is mainly used in Web application development, PHP entry threshold is lower, Easy to learn, widely used, mainly applicable to the field of web development. PHP's file suffix is named PHP.

  How does the php file open?

PHP File Open method is very simple we can directly use Notepad text can be hit, if it is web development applications we can use DW Notepad + + Eclipse PDT Notepad2, etc. can be opened, this open can only see the source file can not be executed.

  How PHP files Run

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 be run in Windows or Linux, supporting environments with iis+php or apache+php environments in Windows

I can also use apache+php or nginx+php environments 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 the php.ini file.

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"

Extension=php_mysql.dll to find;

Modified to Extension=php_mysql.dll

find; Session.save_path = "/tmp"

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

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

PHP.ini can be used directly in this catalogue. Suitable 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.

Create a new Notepad file in this directory, and rename the index.php content to be index.php for use in this directory.

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

Read run permissions on c:/php. (If D disk 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 Key Site--Properties--"Home directory" option.

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

8> IIS back up. You can implement the IIS site to support PHP scripts.

Settings for PHP coexisting with IIS

The first step is to unlock the PHP5.0 compression pack, which you can put underneath the c:/php5.

The second step is to copy the Php.ini-dist file below the C:/PHP5 to the Winnt directory and rename it to PHP.ini. You do not need to modify any of the parameters can be run, of course, depending on the circumstances you can modify some of the parameters.

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

Step fourth, start Computer Management.

Step fifth, expand Services and Applications/Internet Information Services on the Computer Management window, right-click on the Default Web site, select Properties, and the Default Web Site Properties window pops up:

Step seventh, on the Default Web Site Properties window, click the ISAPI Filter tab, tap the Add button, enter "PHP" in the filter name in the Pop-up Filter Properties window, and "C:/php5/sapi/php5isapi.dll" in the executable. Are you sure.

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

Step 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 relevant service. Wait until all is closed.

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

  Apache Configuration PHP Environment

1. We install the Apache environment in the computer,

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

And then we'll add to the Apache

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

AddType application/x-httpd-php. php

Phpinidir "C:/PHP5"

and restart Apache, so it's configured.

Then we create a website to put the PHP file in the Site directory can be run, the code is as follows

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

echo Test

?>

Output is

HELLO World

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

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.