Wordpress FTP 本地主机的连接设置以上传和安装 WooCommerce
Wordpress FTP connection setting for localhost to upload and install WooCommerce
我无法上传 WooCommerce .zip 文件并在本地主机上安装插件。每次我单击安装按钮时,Wordpress 都会询问 FTP 凭据的连接信息,如下图所示:
尽管我输入了 localhost 作为主机名和 admin 作为用户名,但还是不行!
好的,我通过在安装 Wordpress 的 htdocs 文件夹中编辑 wp-config.php 解决了这个问题 -> 如图 1:
我将以下行添加到 wp-config.php 中,如图 2
define('FS_METHOD','direct');
define("FTP_HOST", "localhost");
define("FTP_USER", "admin");
define("FTP_PASS", "1234");
用户名和密码与我安装Wordpress时传的用户名一致
只需将 define('FS_METHOD','direct');
添加到您的 wp-config.php。
尝试:
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/themes/
然后将这些添加到 wp-config.php
:
/** Add here*/
define('FS_METHOD','direct');
define("FTP_HOST", "localhost");
define("FTP_USER", “my_wordpress_user”);
define("FTP_PASS", “password”);
/** To here*/
上一行中,my_wordpress_user
和password
是wordpress中使用的。
推荐:
如果你使用的是centos:
//Set www to 777
# chmod -R 777 /var/www/html
// Change the owner to apache
# chown -R apache:apache /var/www/html
// Restart httpd
# systemctl restart httpd
不推荐但有效:
在wp-config.php
中添加这一行
define( 'FS_METHOD', 'direct' );
我无法上传 WooCommerce .zip 文件并在本地主机上安装插件。每次我单击安装按钮时,Wordpress 都会询问 FTP 凭据的连接信息,如下图所示:
尽管我输入了 localhost 作为主机名和 admin 作为用户名,但还是不行!
好的,我通过在安装 Wordpress 的 htdocs 文件夹中编辑 wp-config.php 解决了这个问题 -> 如图 1:
我将以下行添加到 wp-config.php 中,如图 2
define('FS_METHOD','direct');
define("FTP_HOST", "localhost");
define("FTP_USER", "admin");
define("FTP_PASS", "1234");
用户名和密码与我安装Wordpress时传的用户名一致
只需将 define('FS_METHOD','direct');
添加到您的 wp-config.php。
尝试:
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/themes/
然后将这些添加到 wp-config.php
:
/** Add here*/
define('FS_METHOD','direct');
define("FTP_HOST", "localhost");
define("FTP_USER", “my_wordpress_user”);
define("FTP_PASS", “password”);
/** To here*/
上一行中,my_wordpress_user
和password
是wordpress中使用的。
推荐:
如果你使用的是centos:
//Set www to 777
# chmod -R 777 /var/www/html
// Change the owner to apache
# chown -R apache:apache /var/www/html
// Restart httpd
# systemctl restart httpd
不推荐但有效:
在wp-config.php
中添加这一行define( 'FS_METHOD', 'direct' );