Easy WordPress Updates: Store FTP Info in wp-config.php
Saw an interesting blog post on Twitter today about storing WordPress FTP information in wp-config.php. The article was written in German so I sent the author an email to ask if he’d mind me translating it. Phil, the author, very kindly said yes – so my translation is below.
Since the addition of the automatic updates in the WordPress core became available, there has been the possibility of FTP data in the backend. Then you can get both plugins and the core by clicking on the date. However WordPress then stores the login information in the blog database. This can be a potential security issue. If someone were to gain access to your database then they would also have access to your entire server. One way of reducing the risk is to use the approach outlined below.
Editing wp-config.php
Access
The wp-config.php file can be used to define constant values so that the usage of a database can be removed. This makes the database smaller, and so improves site performance. For the FTP access the constants are as follows and should be added to the bottom of your wp-config.php file:
define('FTP_HOST', 'ftp.example.org');
define('FTP_HOST', 'ftp.example.org:2121');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
Secure Connection
For a secure connection add the following line (default: false):
define('FTP_SSL', true);
Directories
If the WordPress installation is not in the root directory of the FTP server you can define the location as follows:
define('FTP_BASE','...');
Have you moved the plugin directory or all of the content folder? You can also specify the full path using these two constants:
define('FTP_CONTENT_DIR', '...');
define('FTP_PLUGIN_DIR', '...');
Method
Finally, you can also adjust the method to be used by WordPress for the file system. This often hides errors if something goes wrong with the file permissions. You should only change this value if errors occur, most of the time the default will work just fine.
define('FS_METHOD', 'direct');
The following methods are possible:
- direct (default) – PHP file system functions
- ssh – SSH PHP Extension
- ftpext – FTP PHP Extension
- ftpsockets – PHP socket extension
The constants FTP_PUBKEY, FTP_PRIKEY display the paths to the SSH public key and private key SSH specify.
Delete existing data
If you’re unsure whether access data already stored on WordPress, you can search the WordPress options in the database using the following page on your website:
http://example.org/wp-admin/options.php
There you should search for the entry: ftp_credentials
If this is present, you have already stored the FTP data in your database. You can delete it by simply removing the value in the ftp_credentials field on the options page, then scrolling to the bottom, and pressing save. You should be very careful doing this though as there is potential for your website to be broken when doing this.
More information
Further Information can be in the WordPress Codex:
Easy WordPress Updates: Store FTP Info in wp-config.php的更多相关文章
- Automatic WordPress Updates Using FTP/FTPS or SSH
Introduction When working with WordPress in a more secure environment where websites are not entirel ...
- Install WordPress Plugins without FTP Access
WordPress will only prompt you for your FTP connection information while trying to install plugins o ...
- WordPress主题制作教程[壹] - 了解WP&结构&索引
最近开始筹备WordPress主题开发了.首先我们在此章节中进行了解什么是WP,以及WP的结构.通过这个文章索引到以后所写的WP系列教程. (抱歉,大家不要急,持续更新中....) 1.首先,我们来认 ...
- 关于wordpress中的contact form7和WP Mail SMTP的一些设置
昨天帮客户解决了这个问题 折腾了好几个小时 下面说下流程 先配置的 wp mail smtp 如果配置完毕后 就可以使用里面配置的邮件 放到contact form7 中的 发件人中 1 ...
- Core - Provide an easy way to store administrator and user model differences in a custom store (e.g., in a database)
https://www.devexpress.com/Support/Center/Question/Details/S32444/core-provide-an-easy-way-to-store- ...
- 【WordPress】CentOS 6.10 测试WP发送邮件失败
1.错误信息如下: SMTP -> ERROR: Failed to connect to server: Permission denied (13) 2.解决方法: https://gist ...
- 解决升级WordPress及插件需输入FTP账号的问题
当添加,删除,升级 WordPress 插件或者直接升级 WordPress 的时候,WordPress 总是提示让你输入 FTP 帐号信息,非些烦人. 我们可以在 wp-config.php 中定义 ...
- 五种WordPress防止垃圾评论方法-过滤垃圾评论提高WP运行效率
WordPress貌似和垃圾评论是一对“孪生兄弟”,无论在国内还是国外的空间主机上搭建的Wordpress博客,无论Wordpress有多少流量多么低的权重,垃圾评论都会自动找上门来,假如有好几天没有 ...
- wordpress常用插件汇总
WordPress之所以能成为目前最具人气的独立博客程序,除了无数爱好者为它开发的主题外,源源不断的插件支持也是重要的原因之一.wordpress的强大,也是在于无数爱好者源源不断的主题和插件. wo ...
随机推荐
- cbow&&skipgram详细
前面:关于层次huffman树和负例采样也要知道的,这里就不详细写了 来源于:https://mp.weixin.qq.com/s?__biz=MzI4MDYzNzg4Mw==&mid=224 ...
- HMM算法
HMM的应用 HMM是生成模型 词性标注:给定一个词的序列(也就是句子),找出最可能的词性序列(标签是词性).如ansj分词和ICTCLAS分词等. 分词:给定一个字的序列,找出最可能的标签序列(断句 ...
- 泛型 for to/in 遍历 PK 效率;TEnumerator、TEnumerable
再使用泛型的时候,经常需要用到遍历功能: 只要继承了 TEnumerator 或 TEnumerable 这两个抽象类的 都具有遍历功能. 当然没有继承这两个抽象类的 也具有使用 for in 来遍历 ...
- Hive与HBase区别 大墨垂杨
大墨垂杨 http://www.cnblogs.com/quchunhui/p/5340989.html
- SQLSERVER中的非工作时间不得插入数据的触发器的实现
create trigger trigger_nameon table_namefor insert,update,deleteasif (datepart(yy,getdate())%4=0 or ...
- Python类和人类
Python中的类 俗话说,物以类聚,人以群分,类是什么,类就是一组相同属性的集合.下面来结合人,探讨Python中类和人类的关系. 首先,我们定义一个人的类,如下: class People(obj ...
- C#一步一步学网络辅助开发(1)--常用抓包工具的使用
这次写的是一个系列,是让大家了解如何进行网络的辅助开发.要进行网络辅助开发抓包工具是必不可少的,下面就让大家熟悉一下常用的一些抓包工具, 1,Fiddler 这个工具是我目前用的最多的一款抓包工具,不 ...
- GTK, GTK+, Qt, KDE, GNOME, Unity的区别与联系
GTK,GTK+, Qt是图形界面开发库(GUI Toolkit),用户可以使用这些开发库编写GUI应用,其中GTK+是GTK的升级版. KDE,GNOME,Unity是linux下的桌面环境(Des ...
- ECSHOP的JS文件代入问题
参考一下默认的js写法就行了<script type='text/javascript' src='themes/ecmoban/js/jquery-1.7.2.min.js'></ ...
- 20169211《Linux内核原理与分析》 第九周作业
一.Linux内核虚拟文件系统学习总结 Linux支持各种文件系统,Linux内核通过虚拟文件系统了对各种文件系统共性的进行抽象,并对外提供统一接口,从面向对象编程的角度来看,称为抽象文件系统更为合适 ...