编辑“WordPress:Answers-Installation”
该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第1行: | 第1行: | ||
<div style="border:1px solid blue; background: #CCFFE6; padding:10px; margin:10px; font-size:130%"> | <div style="border:1px solid blue; background: #CCFFE6; padding:10px; margin:10px; font-size:130%"> | ||
These FAQs have been deprecated. You will find the new updated '''Frequently Asked Questions''' on the new pages for the [[WordPress:FAQ]]. | These FAQs have been deprecated. You will find the new updated '''Frequently Asked Questions''' on the new pages for the [[WordPress:FAQ]]. | ||
</div> | </div> | ||
[[WordPress:FAQ|Back to FAQ]] | [[WordPress:FAQ|Back to FAQ]] | ||
== PHP and MySQL Requirements == | == PHP and MySQL Requirements == | ||
You certainly need PHP (version 4.1 or newer) and MySQL (version 3.23.23 or newer) to power your WordPress blog. PHP is the scripting language that drives all of WordPress, and without PHP, your server will not be able to interpret the pages that create your weblog. MySQL is a relational database, and WordPress works '''only''' with MySQL. Other databases are not supported at the moment. | You certainly need PHP (version 4.1 or newer) and MySQL (version 3.23.23 or newer) to power your WordPress blog. PHP is the scripting language that drives all of WordPress, and without PHP, your server will not be able to interpret the pages that create your weblog. MySQL is a relational database, and WordPress works '''only''' with MySQL. Other databases are not supported at the moment. | ||
== MySQL 4.1.7 == | == MySQL 4.1.7 == | ||
Do NOT use this version of mysql if you are trying to get WordPress installed using a Windows platform. Read this post originally made to the forums: | Do NOT use this version of mysql if you are trying to get WordPress installed using a Windows platform. Read this post originally made to the forums: | ||
<blockquote> | <blockquote> | ||
"To all those having problems installing Wordpress on your own Windows 2000 (and other Win OS versions) workstation - and maybe some host servers, too: Do not use MySQL 4.1.7 - it is the problem if you get "Error establishing a database connection!". It does not seem compatible with the other components. Use MYSQL 4.0.22 instead. | "To all those having problems installing Wordpress on your own Windows 2000 (and other Win OS versions) workstation - and maybe some host servers, too: Do not use MySQL 4.1.7 - it is the problem if you get "Error establishing a database connection!". It does not seem compatible with the other components. Use MYSQL 4.0.22 instead. | ||
Thanks to the Reply by ADAMANT in response to the POST of Nov 6, 2004 02:21:29 by ANTOINE, the Wordpress installation really did become only 5 minutes, after two days of frustration: | Thanks to the Reply by ADAMANT in response to the POST of Nov 6, 2004 02:21:29 by ANTOINE, the Wordpress installation really did become only 5 minutes, after two days of frustration: | ||
I started with Windows 2000, PHP 4.3.9, Apache 1.3.33 and MySQL 4.1.7. I spent two days checking my wp-config.php literally 100 times; making changes; troubleshooting my database, using every known name for my host (localhost, 127.0.0.1, <IP address>, computer name, etc...) to no avail. I kept getting: | I started with Windows 2000, PHP 4.3.9, Apache 1.3.33 and MySQL 4.1.7. I spent two days checking my wp-config.php literally 100 times; making changes; troubleshooting my database, using every known name for my host (localhost, 127.0.0.1, <IP address>, computer name, etc...) to no avail. I kept getting: | ||
"Error establishing a database connection!" ... | "Error establishing a database connection!" ... | ||
I knew it wasn't my config. So thanks to ADAMANT's suggestion, I uninstalled MySQL 4.1.7 and downloaded and installed MySQL 4.0.22 from mysql.org. After installing and configuring the new (old) MySQL, which took approximately 7 minutes (very easy), I ran the install.php once again and YES!! it actually took less than 5 minutes for the Wordpress install. | I knew it wasn't my config. So thanks to ADAMANT's suggestion, I uninstalled MySQL 4.1.7 and downloaded and installed MySQL 4.0.22 from mysql.org. After installing and configuring the new (old) MySQL, which took approximately 7 minutes (very easy), I ran the install.php once again and YES!! it actually took less than 5 minutes for the Wordpress install. | ||
NOTE: the Apache web site says NOT to use Apache 2 in production. So, after all my wasted time with the latest MySQL, I suggest the following to those who can control their environment: | NOTE: the Apache web site says NOT to use Apache 2 in production. So, after all my wasted time with the latest MySQL, I suggest the following to those who can control their environment: | ||
PHP 4.3.9, Apache 1.3.33 and MySQL 4.0.22. On Windows at least, they all work well together." | PHP 4.3.9, Apache 1.3.33 and MySQL 4.0.22. On Windows at least, they all work well together." | ||
Steven | Steven | ||
</blockquote> | </blockquote> | ||
['''UPDATE''': MySQL 4.1.7 uses a new password encryption system that is incompatible with prior methods. If you want to get WordPress working with a 4.1.7 database, you need to make sure your user password is set as an old-style password (password-old instead of password, if you're using mysqladmin). -- Nabil] | ['''UPDATE''': MySQL 4.1.7 uses a new password encryption system that is incompatible with prior methods. If you want to get WordPress working with a 4.1.7 database, you need to make sure your user password is set as an old-style password (password-old instead of password, if you're using mysqladmin). -- Nabil] | ||
Note : The above are actual user comments, and may be subjective in their content. It is hoped that it will be of help to some users who face the specific problems that are addressed by this question.. | Note : The above are actual user comments, and may be subjective in their content. It is hoped that it will be of help to some users who face the specific problems that are addressed by this question.. | ||
==Why does WordPress use MySQL?== | ==Why does WordPress use MySQL?== | ||
MySQL is extremely fast. It's also the most widely available database server in the world. Open-source and free, MySQL is supported by thousands of low-cost Linux (and Windows!) hosts, which means a very low barrier to entry for anyone wanting to start a WordPress (or database-driven) website. MySQL's [http://www.mysql.com/documentation/ documentation] is useful, cogent and thorough. (Though it may be intimidating if you're new to all this.) Add to all that the fact that users are able to directly manipulate MySQL with [[WordPress:phpMyAdmin]], developed expressly for that purpose, and it's obvious that MySQL is the best choice. Of course, WordPress insists on the best. | MySQL is extremely fast. It's also the most widely available database server in the world. Open-source and free, MySQL is supported by thousands of low-cost Linux (and Windows!) hosts, which means a very low barrier to entry for anyone wanting to start a WordPress (or database-driven) website. MySQL's [http://www.mysql.com/documentation/ documentation] is useful, cogent and thorough. (Though it may be intimidating if you're new to all this.) Add to all that the fact that users are able to directly manipulate MySQL with [[WordPress:phpMyAdmin]], developed expressly for that purpose, and it's obvious that MySQL is the best choice. Of course, WordPress insists on the best. | ||
There are several other excellent database storage engines, such as PostgreSQL and SQLite that WordPress is interested in supporting in the future. Suppporting multiple databases is trickier than it sounds and is not under active development, although there are plenty of architectural discussions about the best approach to take. Approaches for increasing the number of supported databases are discussed at [[WordPress:Using Alternative Databases]]. There is a PostgreSQL port of WordPress available called [http://wordpress-pg.sourceforge.net/ WordPress-Pg]. | There are several other excellent database storage engines, such as PostgreSQL and SQLite that WordPress is interested in supporting in the future. Suppporting multiple databases is trickier than it sounds and is not under active development, although there are plenty of architectural discussions about the best approach to take. Approaches for increasing the number of supported databases are discussed at [[WordPress:Using Alternative Databases]]. There is a PostgreSQL port of WordPress available called [http://wordpress-pg.sourceforge.net/ WordPress-Pg]. | ||
== Upload Path == | == Upload Path == | ||
When you specified the upload path, you used backslashes. | When you specified the upload path, you used backslashes. | ||
Use forward slashes "/" to specify the directory. | Use forward slashes "/" to specify the directory. | ||
<!-- == Reset Password == | <!-- == Reset Password == | ||
{{merge-section-into|[[WordPress:Resetting your password]]}} | {{merge-section-into|[[WordPress:Resetting your password]]}} | ||
Passwords for WordPress users are stored in an encrypted format called MD5. This is a relatively common security technique that prevents a hacker from obtaining a list of passwords even if they obtain direct access to the database tables. MD5 is a one-way hashing procedure, meaning that it verges on the impossible to restore an encrypted password to its original form. | Passwords for WordPress users are stored in an encrypted format called MD5. This is a relatively common security technique that prevents a hacker from obtaining a list of passwords even if they obtain direct access to the database tables. MD5 is a one-way hashing procedure, meaning that it verges on the impossible to restore an encrypted password to its original form. | ||
Because WordPress uses MD5 to encrypt passwords in the database, a password must be encrypted ''before'' it is inserted in the database. The MySQL database provides tools for this purpose, and there are many tools available online to create MD5 hashes from passwords. | Because WordPress uses MD5 to encrypt passwords in the database, a password must be encrypted ''before'' it is inserted in the database. The MySQL database provides tools for this purpose, and there are many tools available online to create MD5 hashes from passwords. | ||
Visit this [http://bfl.rctek.com/tools/?tool=hasher MD5 Hasher] to get an MD5 hash of a password instantly, or if you know the Python language, [http://www.python.org/cgi-bin/moinmoin/Md5Passwords use this Python code]. | |||
'''For phpMyAdmin''' | '''For phpMyAdmin''' | ||
If you have [[WordPress:phpMyAdmin]] access on your server, you can do the following to reset your admin password manually in case you need to : | If you have [[WordPress:phpMyAdmin]] access on your server, you can do the following to reset your admin password manually in case you need to : | ||
# Open phpMyadmin and be sure that your WordPress database is selected. | # Open phpMyadmin and be sure that your WordPress database is selected. | ||
# Click on the users table in the left menu (it could be wp_users, or ''yourprefix_''users) | # Click on the users table in the left menu (it could be wp_users, or ''yourprefix_''users) | ||
# Click "Browse" at the top of the right frame. | # Click "Browse" at the top of the right frame. | ||
# Click on the edit button next to the admin user. | # Click on the edit button next to the admin user. | ||
# Replace whatever is in the user_pass field with your new password or MD5 hash. | # Replace whatever is in the user_pass field with your new password or MD5 hash. | ||
# If your password is not already encrypted, select “MD5� from the dropdown in the Function column for the user_pass field. (phpMyAdmin will encrypt your password in MD5 if this is set) | # If your password is not already encrypted, select “MD5� from the dropdown in the Function column for the user_pass field. (phpMyAdmin will encrypt your password in MD5 if this is set) | ||
# Save the info in the database by clicking "Go" at the bottom of the form. | # Save the info in the database by clicking "Go" at the bottom of the form. | ||
# Login to Wordpress using “admin� and the password you used to create the hash. | # Login to Wordpress using “admin� and the password you used to create the hash. | ||
'''For command line MySQL''' | '''For command line MySQL''' | ||
You might have direct access to your MySQL database from the command line. Usually this is done by sitting at your server, connecting directly to your server via SSH, or using the MySQL client on your workstation to connect to your server. You must be in the correct context to successfully execute the ''mysql'' command mentioned below. | You might have direct access to your MySQL database from the command line. Usually this is done by sitting at your server, connecting directly to your server via SSH, or using the MySQL client on your workstation to connect to your server. You must be in the correct context to successfully execute the ''mysql'' command mentioned below. | ||
To reset your WordPress password from the MySQL command line, do the following (replace the options in italics with your settings): | To reset your WordPress password from the MySQL command line, do the following (replace the options in italics with your settings): | ||
# "mysql -u root -p" (Logs in to MySQL) | # "mysql -u root -p" (Logs in to MySQL) | ||
# Enter your password at the prompt. | # Enter your password at the prompt. | ||
# "use <i>name-of-database</i>" (Selects your WordPress database) | # "use <i>name-of-database</i>" (Selects your WordPress database) | ||
# "show tables LIKE '%users';" (Finds the WordPress user table) | # "show tables LIKE '%users';" (Finds the WordPress user table) | ||
# "SELECT ID, user_login, user_pass FROM <i>name-of-table-you-found</i> WHERE user_login = '<i>username</i>';" (Observe the encrypted password) | # "SELECT ID, user_login, user_pass FROM <i>name-of-table-you-found</i> WHERE user_login = '<i>username</i>';" (Observe the encrypted password) | ||
# "UPDATE <i>name-of-table-you-found</i> SET user_pass=MD5('<i>new-unencrypted-password</i>') WHERE user_login = '<i>username</i>';" (Updates the database with the encrypted password) | # "UPDATE <i>name-of-table-you-found</i> SET user_pass=MD5('<i>new-unencrypted-password</i>') WHERE user_login = '<i>username</i>';" (Updates the database with the encrypted password) | ||
# "SELECT ID, user_login, user_pass FROM <i>name-of-table-you-found</i> WHERE user_login = '<i>username</i>';" (Confirm that it was changed) | # "SELECT ID, user_login, user_pass FROM <i>name-of-table-you-found</i> WHERE user_login = '<i>username</i>';" (Confirm that it was changed) | ||
# "exit" (Exits the MySQL client) | # "exit" (Exits the MySQL client) | ||
# Login to WordPress using the username and password that you've altered. | # Login to WordPress using the username and password that you've altered. | ||
--> | --> | ||
== Delete Files == | == Delete Files == | ||
There are no files that you must delete. | There are no files that you must delete. | ||
There are no risks to your WordPress files or your database by leaving all the files exactly as they were when you uploaded them. | There are no risks to your WordPress files or your database by leaving all the files exactly as they were when you uploaded them. | ||
However, it is safe to delete the following: | However, it is safe to delete the following: | ||
*license.txt | *license.txt | ||
*Readme.html | *Readme.html | ||
*the import*.php files | *the import*.php files | ||
== Rename Folder == | == Rename Folder == | ||
If you have not installed WordPress, you can rename the folder with the WordPress files. | If you have not installed WordPress, you can rename the folder with the WordPress files. | ||
If you have already installed WordPress, and you want to rename the folder, login to the weblog as the administrator and change the following settings in Options->General : | If you have already installed WordPress, and you want to rename the folder, login to the weblog as the administrator and change the following settings in Options->General : | ||
* WordPress address (URI): | * WordPress address (URI): | ||
* Blog address (URI): | * Blog address (URI): | ||
Once you have done this, you can rename the directory or folder with the wordpress files in it. | Once you have done this, you can rename the directory or folder with the wordpress files in it. | ||
== Safe Mode == | == Safe Mode == | ||
Most definitely! There are no known issues with any version of WordPress when PHP is running in Safe Mode. | Most definitely! There are no known issues with any version of WordPress when PHP is running in Safe Mode. | ||
== allow_url_fopen == | == allow_url_fopen == | ||
In order to accept incoming pingbacks, you have to set 'allow_url_fopen = On' in php.ini. | In order to accept incoming pingbacks, you have to set 'allow_url_fopen = On' in php.ini. | ||
== 403 Error == | == 403 Error == | ||
Symptoms: | Symptoms: | ||
You cannot seem to login after using the right username and password, into your admin account. | You cannot seem to login after using the right username and password, into your admin account. | ||
You get an error message like : | You get an error message like : | ||
You are not authorized to view this page | You are not authorized to view this page | ||
You might not have permission to view this directory or page using the credentials you supplied. | You might not have permission to view this directory or page using the credentials you supplied. | ||
第288行: | 第126行: | ||
HTTP Error 403 - Forbidden'' | HTTP Error 403 - Forbidden'' | ||
Solution: | |||
If your account is hosted on a Windows server, it could be a problem with the Directory Indexes. The default configuration of the server is to load index.htm, index.html, default.htm, default.html, default.asp files. | |||
Wordpress is done in PHP so the default page is index.php. Now this is not part of the default configuration so we need to add it. To do this, you need to click on Web Options in the Control Panel. Then scroll down to the Directory Indexes section to add index.php to the Directory Indexes. | Wordpress is done in PHP so the default page is index.php. Now this is not part of the default configuration so we need to add it. To do this, you need to click on Web Options in the Control Panel. Then scroll down to the Directory Indexes section to add index.php to the Directory Indexes. | ||
You could also contact your webhost for support in this matter. | You could also contact your webhost for support in this matter. | ||
== Create Database == | == Create Database == | ||
In the setup of WordPress, it will ask to setup the database. The appropriate answers are "Yes" and "No". | In the setup of WordPress, it will ask to setup the database. The appropriate answers are "Yes" and "No". | ||
* If your hosting plan allows only one [[WordPress:Glossary#MySQL|MySQL database]], you will probably need to answer "Yes". | * If your hosting plan allows only one [[WordPress:Glossary#MySQL|MySQL database]], you will probably need to answer "Yes". | ||
* If your [[WordPress:Using_cPanel|cPanel]] tells you the name of your [[WordPress:Glossary#MySQL|MySQL database]], then just enter that into DB NAME in [[WordPress:Editing wp-config.php|wp-config.php]]. | * If your [[WordPress:Using_cPanel|cPanel]] tells you the name of your [[WordPress:Glossary#MySQL|MySQL database]], then just enter that into DB NAME in [[WordPress:Editing wp-config.php|wp-config.php]]. | ||
* If you have multiple databases you can use, you will need to create the database, and then assign that name to DB NAME in [[WordPress:Editing wp-config.php|wp-config.php]] so that WordPress knows which database to use when installing. | * If you have multiple databases you can use, you will need to create the database, and then assign that name to DB NAME in [[WordPress:Editing wp-config.php|wp-config.php]] so that WordPress knows which database to use when installing. | ||
* See [[WordPress:Installation#Detailed_Instructions|Installation, Detailed Instructions]] | * See [[WordPress:Installation#Detailed_Instructions|Installation, Detailed Instructions]] | ||
== PHP Version == | == PHP Version == | ||
To get information about your server, you can use the PHP Info function: | To get information about your server, you can use the PHP Info function: | ||
*Paste this into a new Notepad / BBEdit file | *Paste this into a new Notepad / BBEdit file | ||
<pre><?php phpinfo(); ?></pre> | <pre><?php phpinfo(); ?></pre> | ||
*Save as '''info.php''' | *Save as '''info.php''' | ||
*Upload to server. Visit in your browser (www.example.com/info.php) | *Upload to server. Visit in your browser (www.example.com/info.php) | ||
*That will give you info about your php version and [[WordPress:Glossary#mod_rewrite| mod_rewrite]]. | *That will give you info about your php version and [[WordPress:Glossary#mod_rewrite| mod_rewrite]]. | ||
== Multiple Blogs == | == Multiple Blogs == | ||
See: [[WordPress:Installing Multiple Blogs]] | See: [[WordPress:Installing Multiple Blogs]] | ||
== Apache == | == Apache == | ||
WordPress works best on [[WordPress:Glossary#Apache|Apache]] 2.x To see your version, the phpinfo script above will tell you what version of Apache your server is running. | WordPress works best on [[WordPress:Glossary#Apache|Apache]] 2.x To see your version, the phpinfo script above will tell you what version of Apache your server is running. | ||
Note: If you are running WordPress 1.5 on [[WordPress:Glossary#Apache|Apache]] 1.3.x you will have trouble [[WordPress:Using Permalinks]] with the %category% permalink structure. "If you are using Apache 1, do not use %category% in your permalink structure." | Note: If you are running WordPress 1.5 on [[WordPress:Glossary#Apache|Apache]] 1.3.x you will have trouble [[WordPress:Using Permalinks]] with the %category% permalink structure. "If you are using Apache 1, do not use %category% in your permalink structure." | ||