Manually configure Windows 7 + nginx + php + mysql + apache server

Source: Internet
Author: User
Tags php example cache and cookies

There are many tutorials on configuring servers on the Internet, but they are clearly written or illustrated. When you practice them, you will find a lot of problems. I will demonstrate them once with dual-server configuration, abandon the integrated environment that I have been using for a long time. By the time I write this note, I have been able to run the project perfectly. During the configuration process, I still encountered many problems and listed them one by one, we hope that you can have a good solution when you encounter the same error. Uninstall the previously installed integrated environment before configuration, and then use the software to clean up the Registry garbage and manage everything, no more name. next, download the Nginx1.2 windows zip file. Generally, msi is not used. zip is a green software and can be used to reinstall the system. Next, download the mysql5.5 and zip versions, which are relatively large and more than 100 MB, the compressed version of msi is much smaller, but the green version of zip is better. all the software here is a win32 system version, tested on Windows 7 flagship version, and downloaded by php 5.2.17, which is the zip version compiled by VC6. Here ts is a secure version, in another version, I have a problem with apache configuration, so remember to use the ts version, that is, the production environment version, and download the source code of the corresponding version. If you are the same as me, I plan to use C/C ++ to develop php extensions. Remember to download the source code of the corresponding version. Otherwise, the compilation extension may fail. Download The phpmyadmin database management package, only a few mb. Select multiple languages and use them later. there is also the apache server. I have not found the zip version for a long time, so I have to download the msi version. there are so many preparations.
Now let's get started. Which one should I install first? I will first decompress php to the C:/web/php5 directory. Later, my development software apache, nginx, and mysql will all be in c: /The corresponding folder in the web is not mentioned much. I put the website directory on the G independent disk, so the myphpadmin and mysql database data at the back are on the G disk. Finally, I used the thinkphp framework to test whether it was successful! Php configuration: Modify php. ini-recommended is php. ini. www.2cto.com row 542 extension_dir = ". /"change to your own directory C:/web/php5/ext, 644-708 for the module to select the desired, remove the semicolon above is enabled. the following lists the commonly used extension = php_curl.dll extension = php_gd2.dll extension = php_mbstring.dll extension = php_mssql.dll extension = php_mysql.dll extension = export extension = php_sqlite.dll line 553 cgi. force_redirect = 1 remove the semicolon from line 2 remove the semicolon cgi. fix_pathinfo = 1 588 rows remove the semicolon and change it to 1 cgi. rfc2616_headers = 1
Remember to add the php Directory, namely php5, to the system environment variables. If you don't, don't read it down. In this way, you don't need to copy it to the system directory system32, because apache configuration is required later. nginx configuration: Decompress the package to the nginx directory and open conf \ nginx. in the conf configuration file, row 44 is the website directory G:/. In row 45, add the index. php example: index index.html index.htm index. php; lines-71 remove #, lines 69 remove/scripts change to the website directory, for example, my G:/because my G disk is the website directory to download runhiddenconsole.exe, the function is to hide the cmd window. create start_nginx.bat and stop_nginx.bat to start and close php and nginx. After these cmd commands, I will provide the download package. You do not need to write four functions by yourself: Start mysql, disable mysql, and start nginx, shut down nginx. in this way, you can start php and create an index on the G drive. php input phpinfo () function to view the configuration. however, it is not possible to list all files like apache. If there is no file, the error 403 is displayed, but you do not have the permission to view the file.
In nginx. add autoindex on to http {} In conf; list the directory autoindex_exact_size off; change the detailed file size to the approximate size autoindex_localtime on; time is the local time. Note that the comment behind the semicolon is not required, then save the file and start it. The default server is port 80. You do not need to enter 127.0.0.1 directly. mysql configuration, decompress it, and create my under the mysql folder. in the INI file, enter [mysqld] basedir = C:/web/mysqldatadir = G:/data. Do not set the character set. Otherwise, error 1067 is returned. This is the file error, set the mysql directory and data directory respectively. Therefore, the data is important to c. run cmd to enter c: \ web \ mysql \ bin. If this happens, run the cd command to enter the command mysqld -- install mysql5 -- defaults-file = C:/web/mysql/my. ini: register the service to the system www.2cto.com.
Net start mysql5 is started, and the corresponding net stop mysql5 is closed. There is a command file downloading behind it. For mysql In the compressed package version, the default user is root, and the password is empty. Add the bin directory of mysql to the environment variable, open cmd and enter mysql-uroot-p. Then, mysql is successfully installed. install phpmyadmin and decompress it to the root directory of the G drive. The folder is phpmyadmin. Now you can operate mysql on the nginx server. However, by default, the password cannot be blank and cannot be logged in. The error 1045 is displayed. modify libraries/config. default. php 422 behavior: config under truephpmyadmin. sample. inc. php 36 acts true. you can use the empty root password. Restart nginx and mysql. first, add the password. next, modify the mysql-user table, add the root password, and use the password function. restart m. Ysql can work normally. Change the preceding two false values to true. after changing the password, you have to restart mysql. It is best to clear the cache and cookies. Otherwise, the 1045 error may easily occur. Remember that the password is correct and cannot be logged in !!!
Apache configuration; one way, the next step is to pay attention to port 8080 in this process. You can also modify the configuration later. after the installation is complete, apache cannot be started. My question is, I think it is caused by the previous installation of the integration environment or nginx. No matter whether it is configured, add the php5 path to the environment variable. Otherwise, apache cannot be started later or copied to system32. Select the former and then open conf/httpd. conf to modify the configuration. serverRoot "C:/web/apache" # apache Server Directory Listen 8080 # port LoadFile "C:/web/php5/libmysql. dll "LoadModule php5_module" C:/web/php5/php5apache2_2.dll "PHPIniDir" C:/web/php5/php. ini "# Start ServerName 127.0.0.1: 8080 in php # Add DocumentRoot" G:/"# website Directory www.2cto.com <Directory" G:/"> # Same as DirectoryIndex index. php index.html # add index. phpAddType application/x-httpd-php. php # Now you can start apache by adding the php file type. It is perfect for mysql and php to be tested using phpmyadmin. no, this is mainly written text, but you can still understand it. It is to modify some configuration files. I will attach my configuration file to the back, and I will create a package, the list is in the respective folders. Note that the two commands for starting nginx cannot be moved out of the nginx folder or cannot be started.


This is the two servers running at the same time, one is port 80, the other is port 8080, And the login to phpmyadmin at the same time. I will upload the file configuration in php, mysql, apache, and nginx I use to the 115 Network Disk and pack it into a package. The configuration file contains an installation note, for reference only! There is also a php source code package, which is not mentioned yet. Later we will talk about c/C ++ extension to develop the php plug-in. The main reason is that the php version is consistent with the source code. Otherwise, an error occurs. I will package it together, VC ++ 6.0 is used for development. Related downloads are available on the Internet. We will not discuss it. At last, let's say that mysql still uses msi and zip is too large. The methods are the same. configuration download: http://up.2cto.com/2012/0604/20120604084938922.rar
115 download php + mysql + apache + nginx software:

Http://115.com/file/ancm0ahu# php?nginx=apache=mysql.rar this article from Qingzhu blog-Yoby

Related Article

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.