1024programmer PHP Mysql+php+apache+wordpress environment building experience

Mysql+php+apache+wordpress environment building experience

I want to start a blog these days, but just setting up a local development environment took me two days, and I kept going back and forth between various versions and errors. Because this is very frustrating, I thought it was necessary to share my solution with everyone. Here I mainly share with you my solutions to some errors. As for the specific operations, you can check out the reference materials I gave.

I want to set up a blog these days, but just setting up a local development environment took me two days, and I kept going back and forth between various versions and errors. Because this is very frustrating, I thought it was necessary to share my solution with everyone. Here I mainly share with you my solutions to some errors. As for the specific operations, you can check out the reference materials I gave.

By the way, my environment is win7 + mysql server5.5.20 + apache2.2.25 + php5.3.29 + wordpress2.7

(php and apache are both installation versions, not installation-free versions).

Reference materials:

MySQL installation detailed graphic version (V5.5For Windows)

http://www.jb51.net/article/28362.htm

Complete uninstall of MySQL

http://blog.sina.com.cn/s/blog_675ce92f0100ryv9.html

php + mysql +apache + wordpress full installation record – stupid kid

http://www.blogjava.net/fl1429/archive/2009/04/24/267307.html

Windows environment configuration Apache+Mysql+PHP

http://www.cnblogs.com/homezzm/archive/2012/08/01/2618062.html

apache cannot start solution

http://jingyan.baidu.com/article/c85b7a642df6f7003bac95d9.html

Troubleshooting apache startup failure

http://wangfei4553693.blog.163.com/blog/static/2701047720127119625311/

Forum: php cannot connect to mysql

http://bbs.csdn.net/topics/360030921?page=1

Install WordPress

http://codex.wordpress.org/zh-cn:%E5%AE%89%E8%A3%85WordPress

1. Regarding the reinstallation of mysql:

??At first, mysal version should be 5.6.20 installed on my computer. Because I forgot the password, I uninstalled it, and then the nightmare came. When I wanted to install mysql server5.6.20 again, I found that I could not reconfigure it, that is, I could not change the password. Okay, then I searched online for how to completely uninstall mysql. It said to delete the registry, so I deleted it, but the situation was still the same after deleting it. It took me a long time to think of trying to change the version, so I changed the version to the lower version 5.5. As expected, I can enter the program to configure mysql. Finally, as for why mysql5.6 cannot be installed normally, the reason remains unknown. If anyone knows, please tell me.

2. Installation and configuration of apache and php:

?? As for why the installation version is used here, it is mainly because if you use the installation-free version, some files will be missing in the installation folder. For example, in the php folder, php5apache2_2.dll, php_mysqli.dll and These files php_mysql.dll will eventually cause problems during configuration. If anyone knows how to configure the installation-free version, please tell me.

The two main problems I encountered here were that the apache service could not be started and php could not connect to mysql:

1. For the first question, there may be three reasons:

  • Port occupation problem;
  • Path and file name problem;
  • Configuration file problem.

For detailed troubleshooting instructions, please refer to the reference materials. What I encountered was the third type of reason. To solve this problem, I would like to recommend a good method to everyone in the reference material “Apache cannot start solution”:

Enter cmd and then enter the Apache installation directory (specifically your own installation directory)\bin>httpd.exe -w -n”Apache2″ -k start (change Apache2 in quotation marks to your Apache service name, mine It is version 2.2.4, the service name is Apache2, you can find it in the computer service), so the command prompt will directly display the errors in your configuration file httpd.conf, which can help you locate which line, which is very practical.


2. Second question:

Possible reasons are:

It is blocked by the firewall; the database port is occupied; the mysql service is not started, etc. But it doesn’t match the situation I encountered. I grabbed a piece of PHP code from the Internet to test:


It means that if the connection to mysql is successful, ‘successful!!!’ will be displayed, and if it fails, an error message will be printed. Well, then it keeps failing. . . The error message is, “The connection cannot be made because the target computer actively refused it.” AtIt’s Baidu. I found a forum, which is “Forum: PHP cannot connect to mysql” in the reference materials. After reading many opinions above, I found at the bottom:

Tried it, oh my god! ! Success! ! ! (The port number here refers to the port of your database)

3. WordPress installation:

After the mysql, php and apache environments are set up, it is not difficult to install wordpress. For details, please refer to “Installing WordPress”.

What should be mentioned here is that there is no need to install any application to create a mysql database. You can just use the command prompt to do it. It is simple and can be found in the code information.

Then there is the problem of connecting to mysql. Referring to the solution to question 2 in Part 2, I thought of adding my port number to ‘DB_HOST’ in the WordPress configuration file wp-config.php, like Like this:

Turns out, this works! !

When setting up the environment, you can roughly follow the steps in the information “php + mysql + apache + wordpress full installation record – stupid kid”. If you encounter problems, check it out Check out the other information I provided, or look for it yourself online. In short, there are always ways, the main thing is to be patient!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/mysqlphpapachewordpress-environment-building-experience-4/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索