I haven’t written a blog for a long time. I am currently learning PHP, so I will share the environment configuration with you. I haven’t blogged for a long time. I am currently learning PHP, so I will share the environment configuration with you.
Software preparation:
The prepared software is shown in the figure below.
Apache has not found a 64-bit version in the official website. Here is an address. It has been tested and can run normally.
Other 32 and 64-bit versions can be found in the official website.
http://www.blackdot.be/?inc=apache/binaries apache 64 bit
Installation of Apache:
Note: This example only takes screenshots that require attention, and other screenshots are not displayed by default.
1. Server information can be configured as default, if the server's 80 port is not occupied by other server programs. Optional "for All Users, on Port 80, as a Service—Recommended." If only for the current user, use 8080Port, start manually, select "only for the Current User, on Port 8080, when started Manually.". The port number can be modified through the configuration file.
2. “Typical” is the default installation, and “Custom” is the user-defined installation.
3. Click "Build Headers and libraries" and select "This feature will be installed on local dirive."
4. You can select "Change" to change the default installation path. In this example, the default installation is used.
5. After the installation is completed, the apache service manager will appear.
There are service projects that can be started now in the service management list.
Note: If the service item apache does not appear in the service management list after installation, it means that an error occurred during the installation process. You can install it manually at this time.
Use cmd to enter C:Program FilesApache Software FoundationApache2.2binThis is the directory where I installed it locally, And execute the httpd -k install command. After success, you can see the apache service in the service management list.
Since this service has been installed normally on my machine, an installation service error is prompted when executing this command. You can search for related execution commands of httpd by yourself.
6. Now you can test whether apache is installed successfully. Enter localhost or 127.0.0.1 in the browser. If you choose not to use port 80 during installation, you need to add the port number when accessing here.
2. You can change the location of the mysql installation directory. In this example, keep the default.
3. After completion, check "Launch the MySql instance Configuration Wizard" to configure MySql.
4. Select the configuration method: "Detailed Configuration (manual precise configuration)", "Standard Configuration (standard configuration)", select "Detailed Configuration",
5. Select the server type, "Developer Machine (development and testing type, mysql takes up very few resources)", "Server Machine (server type, mysql takes up more resources)", "Dedicated MySQL Server Machine (specialized database server, mysql takes up more resources)" All available resources)", generally select "Server Machine". You can choose according to the actual situation. This example uses the development test type.
6. Select the general purpose of the mysql database, "Multifunctional Database (general multifunctional, good)", "Transactional Database Only (server type, focused on transaction processing, general)", "Non-Transactional Database Only (non-transactional) , relatively simple, mainly used for some monitoring and counting, the support for MySAM data types is limited to non-transactional)", select "Transactional Database Only", in this example, the general multi-function type is selected.
7. Configuring the InnoDB Tablespace is to select a storage space for the InnoDB database file. If it is modified, remember the location and choose the same place when reinstalling, otherwise the database may be damaged. Of course, make a change to the database. Backing up is no problem. Use the default location.
8. Select half of the website's mysql visits and the number of simultaneous connections, "Decision Support (DSS)/OLAP (about 20)", "Online Transaction Processing (OLTP) (about 500)", "Manual Setting" , enter a number yourself)" and select "Online Transaction Processing (OLTP)". In this example, the first option is selected because the development and testing work is only done on this machine.
9. Whether to enable TCP/IP connection and set the port. If not, you can only access the mysql database on your own machine. Select "Enable TCP/IP Networking" to enable TCP/IP connection and set the port. If not, If enabled, you can only access the mysql database on your own machine, select "Enable TCP/IP Networking".
10. Set the database language encoding. "Standard Character Set" is Western encoding, "Best Support For Multilingualism" is RTF-8 encoding, "Manual Selected Default Character Set/Collation" is manually set encoding, and gbk and gb2312 are Chinese encoding. Select "Best Support For Multilingualism".
11. Select "Install As Windows Service" to install the MySql service and customize the name of the service.
"Include Bin Directory in Windows PATH" is an environment variable that adds MySql on the machine.
12. Select "Modify Security Settings" and check "Enable root access from remote machines" according to actual requirements to enable access from other machines.
13. After completing the configuration, click "Execute" to execute the configuration.
MySql installation operation has been completed.
Test MySql
-------------------------------------------------- -------------------------------------------------- ----------------------------------------
Installation of Php:
Extract the php-compressed package to the corresponding directory. In this example, I placed it in the E:Program FilesPHP folder.
Configuration of Php:
1.
4. default_charset="utf-8"
5、
5. Set extension=php_exif.dll, php_gd2.dll, php_imap.dll, php_mbstring.dll, php_mcrypt.dll, php_mime_magic.dll, php_mysql.dll, php_mysqli.dll, php_pdf Remove the semicolon ";" in front of .dll.
6. Add to [PATH] in [Environment Variable]:; E: Program Filesphp; E: Program Filesphpext.
7.
1. When writing PHP programs, this warning sometimes appears: PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:xxxxxxxxx.php on line 10 . This is because the time taken by PHP is Greenwich Mean Time, so it will be different from your local time. The difference between Greenwich Mean Time and Beijing time is about 8 hours. We can solve it according to the following method: 1. The header uses date_default_timezone_set() to set my default time zone to Beijing time, that is, . 2. Set the value of date.timezone in php.ini to PRC. After setting it, it will be: date.timezone=PRC. At the same time, uncomment this line of code, that is, remove the preceding semicolon.
Configuration of httpd.conf:
The location of the httpd.conf file: C:Program FilesApache Software FoundationApache2.2conf.
This is the directory where I installed it locally. Note: There are many tutorials on the Internet saying that you need to copy a certain dll file in the php directory to system32, actually this is not necessary, just load phphttpd.conf >Module is enough.
Add and modify the following statement lines: LoadModule php5_module "E:/PHP/php5apache2_2.dll" (You need to add the "" sign, otherwise apache cannot start)
【ps:
If there is no php5apache2_2.dll in the installation directory of php, the downloaded version must be wrong.
There are several paragraphs of text on the left side of the official website:
Which version do I choose?
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP. . . .
So you downloadV6C versions of PHP
VC6 x86 Non Thread Safe
VC6 x86 Thread Safe
One is Thread Safe, the other is Non Thread Safe,
As a result, Non Thread Safe version of php did not have ApacheOptions for :
select the web server you wish to setup
IIS FastCGI
Other CGI
Do not setup a web server
The installation process of Thread Safe version has Apache 2.2.x Module option:
select the web server you wish to setup
Apache 2.2.x Module
Apaceh CGI
IIS FastCGI
IIS CGI
NSAPI
Xitami
NetServe Web Server
Other CGI
Do not setup a web server】
-------------------------------------------------- -------------------------------------------------- --
PHPThere are several different versions to choose from when downloading. That is VC6 X86 and VC9 X86.
First let me answer:
VC6What is it?
VC6 is the legacy Visual Studio 6 compiler, which is compiled using this compiler.
VC9What is it?
VC9 is the Visual Studio 2008 compiler, which is compiled with Microsoft's VS editor .
So how do we choose which version of PHP to download?
If you are using Apache+PHP under windows, please select VC6Version;
If you are using IIS+PHP under windows, please select VC9Version;
What is Non Thread Safe?
Non Thread Safe is non-thread safe;
Thread Safe What is ?
Non Thread Safe is thread safe;
Officially it is not recommended that you use Non Thread Safe in a production environment, so we choose the Thread Safe version PHP to use.
PHPIniDir "E:/Program Files/PHP"
[
If it appears when you connect to the MySql database
Fatal error: Call to undefined function mysql_connect() in C:xxxxx.php
That's because you didn't increase this attribute.
]
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" The default storage path of the project, which can be modified according to the actual situation. Note: If this node is modified, the corresponding DirectoryThe directory of the node also needs to be modified.
<span style="color: red; font-size: 10.5pt"> php.ini-development </span><span style="color: red; font-size: 10.5pt">开发用的</span>
The config method is to enter the access URL of phpMyAdmin to enter directly without entering the user name and password. It is unsafe and not recommended.
When this is set to cookie, http or HTTP When logging in phpMyAdmin requires data username and password for verification, as follows:
PHP installation mode is Apache , you can use http and cookie ;
PHP installation mode is CGI , you can use cookies.
5. Phrase password (blowfish_secret) settings
6. Modify the interface language
Modify this attribute to zh[Simplified Chinese]
7. TestPhpMyAdmin
7. Well, I have to admit this is an amazing website. The reason is that we did not start this service after installing apache.
8. As you can see, he worked.
Apache is now installed.
-------------------------------------------------- -------------------------------------------------- ----------------------------------------
Mysql installation:
1.Select user-defined configuration here