PHP custom installation _ PHP Tutorial

Source: Internet
Author: User
Tags vc9
PHP custom installation. PHP custom installation ① custom installation (you must stop the apache service in the management, uninstall apache, and then do not need to restart the computer during installation) apache + php + mysql + phpmyadmin self-installation we have built PHP custom installation

① Custom installation (you must stop the apache service in the management, uninstall apache, and then do not need to restart the computer during installation)

Self-installation of apache + php + mysql + phpmyadmin

We recommend that you install it in the same folder during installation and manage it (the folder should not be Chinese)

After one test is installed.

1. apache

Http: // locahost after completion

2. php core package (used to support php development, similar to JDK in java)

VC6 is compiled by the legacy Visual Studio 6 compiler.
VC9 is the Visual Studio 2008 compiler, which is compiled by Microsoft VS editor.

So how do we choose which PHP version to download?
If you are using Apache + PHP in windows, select VC6;
If you are using IIS + PHP in windows, select VC9;

What is Non Thread Safe?
Non-Thread Safe is Non-Thread security;
What is Thread Safe?
Thread Safe is Thread security;
We do not recommend that you use Non-Thread Safe in the production environment, so we use PHP of Thread Safe.

The installation of the php core package is to decompress the package.

3. how to integrate apache and php

That is to say, how can apache process php?

① Add the following code to the httpd. conf loading module under the conf directory of apache:

LoadModule php5_module php installation path/php5apache2_2.dll(It must be php5 and apache2.2 !!!!!!!!)

Installation Path of PHPIniDir php module

AddType application/x-httpd-php. php. phtml

Note: We only need to change the red part to the actual php installation path.

Addtype indicatesYou must call this tool to complete resolution only when the suffix of the requested file is. php. phtml.

② Why should I change the php. ini-development file to php. ini? because our php settings need to be modified in php. ini.

② You can specify the corresponding functional modules in php. ini.

Here we need to specify the php Extension Library path

Extension_dir = php module installation path/ext (line 1)

Since php is already an apache module, although php. ini is used by the php module, apache is responsible for loading. Restart apache.

Test whether the integration of apache and php is successful

Write such a piece of code

Phpinfo ();

?>

Restart http: // localhost/test. php

4. install the mysql database (the registry should be cleaned up when the database is detached, otherwise the installation will never respond)

Test whether mysql can be used

1. write a php code to test whether it is successful!

// You cannot understand it at present. it doesn't matter.

$ Conn = mysql_connect (localhost, root, password );

If ($ conn ){

Echo connection to mysql database OK;

} Else {

Echo failed to connect to the database;

}

?>

When php is not correctly configured

Fatal error: Call to undefined function mysql_connect () inC: myenvapachehtdocs emp. phpOn line3

Cause: The mysql function is not enabled currently. in php. ini

Extension = php_mysql.dll

Extension = php_mysqli.dll

2. install phpmyadmin (this website can actually better manage mysql) to see if it can be used

Decompress the package to the htdocs directory, and then you can directly access

Http: // localhost/phpmyadmin/index. php.

14. now, we will install a discuz forum in our own php Development/running environment.

Http://jingyan.baidu.com/article/86f4a73e5bb53237d652693c.html

① Prepare a discuz Forum code

② Decompress it to the htdocs Directory

③ Copy the upload file of discuz to the discuz folder and delete the upload folder.

④ Modify config. inc. php

// [CH] modify the following variables based on the account parameters provided by the space provider. if you have any questions, contact the server provider.

$ Dbhost = 'localhost'; // database server

$ Dbuser = 'root'; // database username

$ Dbpw = 'root'; // database password

$ Dbname = 'discuz'; // database name

$ Pconnect = 0; // database persistent connection 0 = disabled, 1 = enabled

// [CH] the security settings of the Forum. adjust the following settings to enhance the security performance and defense performance of the Forum.

$ Adminemail = 'admin @ your.com '; // system administrator Email

$ Forumfounders = 'admin ';

⑤ Http: // localhost/discuz

If you are sorry, set short_open_tag in php. ini to On. Otherwise, the forum cannot be installed. Modify

① Custom installation (you must stop the apache service in the management, uninstall apache, and then do not need to restart the computer during installation) install apache + php + mysql + phpmyadmin...

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.