


Install Apache2.4 MySql5.7 PHP5.6 under windows environment, apache2.4mysql5.7_PHP tutorial
Install Apache2.4 MySql5.7 PHP5.6, apache2.4mysql5.7 in windows environment The words are undoubtedly of great help, because the fool-proof installation and use method saves us a lot of unnecessary trouble. But as a qualified PHP developer, mastering the installation and configuration of PHP MySQL Apache is a must-have ability. Below I will introduce the installation and configuration methods of the current relatively new versions of PHP, Apache, and MySQL one by one.
The following article refers to the 3 sources, plus the repair and improvement notes of the problems encountered during the construction process:《Construction of PHP environment and installation of Discuz!》
http://www.myxzy.com/post-386.html
http://www.discuz.net/thread-3258186-1-1.html
Most of the current one-click installation packages are 32-bit and do not support 64-bit. If used directly on a 64-bit system, an error will be reported, so here I will talk about how to build Apache PHP MySQL on a Windows 64-bit system. Environmental!The Windows 2008 64-bit Simplified Chinese version I am using for demonstration here, apache, php, and mysql mostly use the 64-bit version. The local environment was created, so I used the default settings.
1. Download PHP, Apache and Mysql software and VC library.
The following are the official website addresses of PHP, Apache and Mysql.
PHP: http://windows.php.net/qa/
Mysql: http://www.mysql.com/downloads/mysql/
Apache: http://www.apachelounge.com/download/win64/
The php, apache, mysql and vc libraries used in this tutorial, download address: Baidu Netdisk
2. Things to note before installation.
Please pay attention to the website where you download PHP and Apache. There are prompts on it to install the Visual C library.
Apache2.4.4 requires VC10 library support, Microsoft Visual C 2010 SP1 Redistributable Package (x64)
PHP5.6 requires VC11 library support, Visual C Redistributable for Visual Studio 2012 Update 1
Note 1: If Apache2.4.4 does not install the VC10 library, the following error will appear.
Error message: "This program cannot be started because MSVCR100.dll is missing from your computer. Try reinstalling the program to solve this problem."
Note 2: If PHP5.5.0beta2 does not install the VC11 library, the following error will appear.
3. Install Apache (under the root directory of drive D)
In line 37, ServerRoot "c:/Apache24" is changed to ServerRoot "D:/discus/Apache24"; //The location of the Apache program.
It doesn’t matter if the ServerAdmin on line 204 is changed or not;
Remove the "#" sign in front of ServerName in line 213;
Change DocumentRoot "c:/Apache24/htdocs" on line 237 to DocumentRoot "D:/discus/Apache24/htdocs"; //Root directory of the website
Line 238
Line 271 DirectoryIndex index.html is changed to DirectoryIndex index.html index.php index.htm //Support more default pages
Line 354 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" is changed to ScriptAlias /cgi-bin/ " D:/discus/Apache24cgi-bin/"
Line 370
(2) Start Apache.
Start --- Run, enter cmd to open the command prompt. Enter the following commands respectively (press enter on each line)
d:
cd Apache24bin
httpd
If httpd.conf is configured correctly, there will be no prompt after entering httpd and pressing Enter. Do not close the command window (closing the command window means closing Apache), access it through a local browser. If "It works" appears, it means that apache has been installed correctly.
(3) Add Apache to the system service
Start --- Run, enter cmd, and open a command prompt. Enter the following commands respectively (press enter on each line)
d:
cd Apache24bin
httpd.exe -k install -n "servicename" \Join the service. servicename is the name in the service and can be customized.
If you want to uninstall this service, you must first stop the service, and then enter httpd.exe -k uninstall -n "servicename" to uninstall the service.
4. Install PHP (under the root directory of drive D)
Here PHP5.5.0 is configured with php5apache2_4.dll. There is no need for the PHP.ini file anymore, just use the PHP default.
(1) Open httpd.conf under Apache24conf and add
at the end
# php5 supportLoadModule php5_module "d:/discuz/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "d: /discuz /php"
(2) Restart the Apache server.
Create a new index.php in the website folder D:/discuz/Apache24/htdocs with the content of Save it. When accessing the php information, it means that php has been successfully installed. As shown below.
5. MySQL installation
MySQL installation is simply through the cmd command. (Enter each line)
d:
cd mysqlbin
MySQLd --install MySQL
net start MySQL
In the php directory
Line 730; extension_dir = "ext", remove the preceding ";" and change it to extension_dir ="d:discuzphpext"
Find extension and add the following two lines
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mbstring.dll (mainly used here for phpMyAdmin to support Chinese)
Restart httpd to test
;D:discuzphpext
phpMyAdmin 4.1.2Installation
http://www.phpmyadmin.net/home_page/downloads.php official website download
Extract it to your website and directory and rename phpMyAdmin (my website root directory is: D:discuzApache24htdocs)
Find the libraries/config.default.php file in the phpMyAdmin directory
Look for password and find two lines, fill in the mysql user and password
$cfg['Servers'][$i]['password'] = '*****';
$cfg['Servers'][$i]['user'] = 'root';
Set $cfg['PmaAbsoluteUri'] = ''; to the phpMyAdmin directory path (such as: http://localhost/phpMyAdmin/)
$cfg['DefaultLang'] = 'en'; Here you can set the encoding zh
$cfg['DefaultConnectionCollation'] = 'utf8_general_ci'; Set database encoding
Test (both apache and mysql have been started) open http://localhost/phpMyAdmin/ and the following page appears, the installation is successful
Fill in the username and password you set previously and log in
Discuz forum setup
Create a new website and directory folder web under the D drive,
Copy the original phpMyAdmin under D:discuzApache24htdocs to the web
Modify the DocumentRoot in the conf/httpd.conf file under apache to DocumentRoot "D:/web"
Restart apache
Edit the test file web.php under D:/web file, edit
Open http://localhost/web.php in the browser and the following picture appears successfully
Discuz! X3 installation graphic tutorial
Download x3.1
http://www.comsenz.com/downloads/install/discuzx
|

TomodifydatainaPHPsession,startthesessionwithsession_start(),thenuse$_SESSIONtoset,modify,orremovevariables.1)Startthesession.2)Setormodifysessionvariablesusing$_SESSION.3)Removevariableswithunset().4)Clearallvariableswithsession_unset().5)Destroythe

Arrays can be stored in PHP sessions. 1. Start the session and use session_start(). 2. Create an array and store it in $_SESSION. 3. Retrieve the array through $_SESSION. 4. Optimize session data to improve performance.

PHP session garbage collection is triggered through a probability mechanism to clean up expired session data. 1) Set the trigger probability and session life cycle in the configuration file; 2) You can use cron tasks to optimize high-load applications; 3) You need to balance the garbage collection frequency and performance to avoid data loss.

Tracking user session activities in PHP is implemented through session management. 1) Use session_start() to start the session. 2) Store and access data through the $_SESSION array. 3) Call session_destroy() to end the session. Session tracking is used for user behavior analysis, security monitoring, and performance optimization.

Using databases to store PHP session data can improve performance and scalability. 1) Configure MySQL to store session data: Set up the session processor in php.ini or PHP code. 2) Implement custom session processor: define open, close, read, write and other functions to interact with the database. 3) Optimization and best practices: Use indexing, caching, data compression and distributed storage to improve performance.

PHPsessionstrackuserdataacrossmultiplepagerequestsusingauniqueIDstoredinacookie.Here'showtomanagethemeffectively:1)Startasessionwithsession_start()andstoredatain$_SESSION.2)RegeneratethesessionIDafterloginwithsession_regenerate_id(true)topreventsessi

In PHP, iterating through session data can be achieved through the following steps: 1. Start the session using session_start(). 2. Iterate through foreach loop through all key-value pairs in the $_SESSION array. 3. When processing complex data structures, use is_array() or is_object() functions and use print_r() to output detailed information. 4. When optimizing traversal, paging can be used to avoid processing large amounts of data at one time. This will help you manage and use PHP session data more efficiently in your actual project.

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
