Website construction site Practice

Source: Internet
Author: User
Tags mysql connect php file upload vc runtime vc9 zend kali linux

---restore content starts---

This holiday came to the telecom company internship, today is the third day. The first day installed Kali Linux, understand some of the infiltration tools, with those tools network penetration seems to be simple, suddenly have some interest in network attack and defense. The next afternoon began to build sites, like the usual in school to do experiments, so also want to write a similar experiment report things. In fact, the building station yesterday just groping a bit, the main work is today completed.

Steps

1, prepare

Do not know at the beginning what these are, after the understanding, Apache is a server, you can also use IIS. PHP is the scripting language for dynamic Web pages. MySQL is a database. Discuz is the forum.

2, install Apache

Follow the steps to get it right. Note that the second step is to change the path to Apache's installation path. Launch Apache can also be used at the command line with the httpd.exe-w-n "Apache2.4"-K start command. The path is to be in the Apache\bin directory when the command is lost.

3,php

PHP installation package is divided into TS and nts two versions, and requires the VC Runtime Library (Vcredist_x86.exe) support, from the installation package file name can be seen, such as: Php-5.4.43-win32-vc9-x86.zip, Php-5.4.43-nts-win32-vc9-x86.zip, Php-5.6.11-nts-win32-vc11-x86.zip, Php-5.6.11-win32-vc11-x86.zip.

From the installation files above we can see that 5.6 is required VC11 support, 5.4 need VC9 support, VC9 and VC11 can be installed on a machine at the same time.

Below we explain the installation configuration of NTS and TS version separately:
1. Unzip the installation package and unzip the directory to C:\AppSoft\PHP

2. Install Microsoft component VC Runtime (Vcredist_x86.exe), otherwise run Php.exe will error

3. Set the system environment variable path, add "; C:\AppSoft\PHP; C:\AppSoft\PHP\ext ", restart your computer

4. Modify the Apache configuration file httpd.conf
A. TS version
DirectoryIndex index.html, DirectoryIndex index.php index.html

Increased support for PHP5
# PHP5 Support
LoadModule php5_module "C:/appsoft/php/php5apache2_4.dll"
AddType application/x-httpd-php. php. html. htm
# Configure the path to PHP.ini
Phpinidir "c:/appsoft/php"

B. Version nts
DirectoryIndex index.html, DirectoryIndex index.php index.html
Options Indexes followsymlinks, Options Indexes followsymlinks execcgi

Added support for PHP5 to copy downloaded mod_fcgid.so to Apache modules directory
# PHP5 support FastCGI with Thread Safety disabled
LoadModule Fcgid_module modules/mod_fcgid.so
<ifmodule mod_fcgid.c>
AddHandler fcgid-script. fcgi. php
# Where to look for the php.ini file?
Fcgidinitialenv PHPRC "c:/appsoft/php"
# Set php_fcgi_max_requests to greater than or equal to fcgidmaxrequestsperprocess
# to prevent php-cgi process from exiting before all requests completed
Fcgidinitialenv Php_fcgi_max_requests 1000
# Maximum requests a process should handle before it is terminated
Fcgidmaxrequestsperprocess 1000
# Maximum Number of PHP processes
Fcgidmaxprocesses 15
# Number of seconds of idle time before a php-cgi process is terminated
Fcgidiotimeout 120
Fcgididletimeout 120
#Path to php-cgi
Fcgidwrapper "C:/appsoft/php/php-cgi.exe". php
# Define the Mime-type for ". php" Files
AddType application/x-httpd-php. php
</IfModule>

5. PHP Configuration
A. TS version
Rename Php.ini-development to php.ini, modify php.ini
; On Windows:
Extension_dir = "C:/appsoft/php/ext"

Configure the php file upload feature
Upload_tmp_dir = "C:/appsoft/php/phpfileuploadtmp"

Because the default PHP does not support the automatic connection of MySQL, etc., you need to open the corresponding extension library function, the
; Extension=php_curl.dll
......
Remove the semicolon (;) in front of it, open all extensions by default, and the following extensions do not open:
Php_interbase.dll
Php_oci8.dll
Php_oci8_11g.dll
Php_oci8_12c.dll
Php_pdo_firebird.dll
Php_pdo_oci.dll
Php_pspell.dll
Php_snmp.dll
Php_sybase_ct.dll

Modify Date.timezone
Date.timezone = Asia/shanghai

Configuring the session Function of PHP
Session.save_path = "C:/appsoft/php/phpfileuploadtmp"

B. Version nts
Rename Php.ini-development to php.ini, modify php.ini
; On Windows:
Extension_dir = "C:/appsoft/php/ext"

Configure the php file upload feature
Upload_tmp_dir = "C:/appsoft/php/phpfileuploadtmp"

Because the default PHP does not support the automatic connection of MySQL, etc., you need to open the corresponding extension library function, the
; Extension=php_curl.dll
......
Remove the semicolon (;) in front of it, open all extensions by default, and the following extensions do not open:
Php_interbase.dll
Php_oci8.dll
Php_oci8_11g.dll
Php_oci8_12c.dll
Php_pdo_firebird.dll
Php_pdo_oci.dll
Php_pspell.dll
Php_snmp.dll
Php_sybase_ct.dll

Modify Date.timezone
Date.timezone = Asia/shanghai

Configuring the session Function of PHP
Session.save_path = "C:/appsoft/php/phpfileuploadtmp"

Finally add Zend Loader settings (Zend Loader in Win32 platform only supports NTS version):
[Zend.loader]
Zend_loader.enable=1
Zend_loader.disable_licensing=1
Zend_loader.obfuscation_level_support=3
Zend_loader.license_path=
zend_extension= "Ext\zendloader.dll"

6. Create the index.php in C:\AppSoft\Apache\htdocs and enter the following:
<?php

Phpinfo ();

?>

Then enter http://localhost in the browser and you'll see the specific configuration page for PHP.

7. After installing the MySQL database, you can use PHP to connect to MySQL to test and see if it is successful.
Enter the following in the index.php:
<?php

$connect =new mysqli ("127.0.0.1", "root", "123456");

if (! $connect) echo "Mysql connect error!";

else echo "MySQL ok!";

$connect->close ();

?>

Then enter http://localhost in the viewer and you'll see "MySQL ok!" Words.

I chose the TS version of 5.4 to follow the steps to be no problem. After the installation of the MySQL test found that, in fact, still need to change a bit.

4, install MySQL

The simplest part ...

6. Installing Diacuz

There's something wrong with the PHP configuration, actually.

Use the method to solve

Complete

(?ω?) Y

Website construction site Practice

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.