


Practical configuration and installation of Apache+php under Windows system_PHP tutorial
Bangkejia (www.Bkjia.com) Tutorials There are too many tutorials on installing apache and php under windows. The editor searched the Internet, but none of them were decent, or they were not right. It’s clear, or it cannot be opened. My personal opinion is not to use the package, because you can practice installing it yourself. Below, I will share the method of installing apache+php by myself as follows:
1. Download the Apache2 and php5 installation packages (search on Baidu yourself)
2. Click directly to install Apache2 (it is recommended not to install the C drive to save trouble). The installation steps are not much different from other software installations, so there is no special statement.
You can ignore the port problem for now. After installation, you can change the port number by modifying the Listen in httpd.config.
Bkjia www.bkjia.com
3. Install PHP5:
Unzip the php5 zip package and put it in a directory you find convenient, such as d:/php5.
4. (1) Copy all dll files in the php folder to c:/windows/system32/ (including all dll files in the ext folder in the php5 directory)
(2) Copy the "php.ini-recommended" file to "c:/windows" and rename it to "php.ini".
5. Modify the php.ini file that has just been renamed:
(1) Find the "extension_dir" field and assign the value to the ext directory in the php decompression path, such as "D:php5ext"
(2) Find the cgi.force_redirect string. The default value is 1. Modify it to 0. And cancel the previous; sign
6. Find the following four sentences respectively and remove the “;” before them.
extension=php_mbstring.dll (wide character, used to support PhpMyAdmin to avoid character display problems)
extension=php_mcrypt.dll (used to support PhpMyAdmin)
Extension=php_mysql.dll (MySql module, you can only access the MySql database after opening it)
extension=php_mysqli.dll (MySql module)
7. Configure Apache to support php5:
Open the "conf" folder in the apache installation directory. Apache configuration mainly relies on httpd.conf. Open the file with a compilation tool and modify some fields in it:
(1)Listen field, the default value is 80, you can modify the port value to change the port of the apache service (so as not to conflict with the port of tools such as tomcat)
(2)DocumentRoot This is the directory where your own web page files are placed. The default is the "htdoc" folder under the apache installation directory. It can also be changed to other directories on the local machine, using absolute paths.
I am using: DocumentRoot "D:/phpwork/" (newly created working directory)
8. Set the start page:
You can copy my configuration here, or you can add the required start page file name yourself. Note that file names are separated by spaces instead of commas
DirectoryIndex index.php index.html default.php default.html index.htm
9. Configure the php module: add two sentences after #LoadModule (there is a row of code) (this is my installation directory, you can make appropriate adjustments according to your own installation situation)
PHPIniDir "D:/php5/"
LoadModule php5_module "D:/php5/php5apache2_2.dll"
10. Save the httpd.conf file and restart Apache. If it starts successfully, create a new liehuo_net.php file under phpwork with the content:
以下为引用的内容: echo "Welcome to Liehuo.Net! "; phpinfo(); ?> |
Enter http://localhost/: the port number you set yourself/liehuo_net.php in the browser. Output the Welcome To Liehuo.Net and php configuration environment variable information. The installation is over. If you have any questions, please comment. !

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Solving the problem of slow Photoshop startup requires a multi-pronged approach, including: upgrading hardware (memory, solid-state drive, CPU); uninstalling outdated or incompatible plug-ins; cleaning up system garbage and excessive background programs regularly; closing irrelevant programs with caution; avoiding opening a large number of files during startup.

The MySQL connection may be due to the following reasons: MySQL service is not started, the firewall intercepts the connection, the port number is incorrect, the user name or password is incorrect, the listening address in my.cnf is improperly configured, etc. The troubleshooting steps include: 1. Check whether the MySQL service is running; 2. Adjust the firewall settings to allow MySQL to listen to port 3306; 3. Confirm that the port number is consistent with the actual port number; 4. Check whether the user name and password are correct; 5. Make sure the bind-address settings in my.cnf are correct.

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

Pull vertical guides in Photoshop: Enable ruler view (View > ruler). Hover the mouse over the vertical edge of the ruler, and then the cursor becomes a vertical line with double arrows and hold and drag the mouse to pull out the reference line. Click Delete by dragging the guide, or hovering it into a cross.

The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

The secrets to mastering Office software include: understanding different versions and platforms, correctly installing and configuring, proficient in using the software interface, in-depth understanding of feature operations, application collaboration and sharing functions, utilizing templates and styles, mastering advanced skills, and solving common problems. In addition, you need to choose a version that suits your needs, make good use of templates and styles, develop backup habits, and learn shortcut keys and advanced techniques to improve efficiency.
