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 ...
随机推荐
- shell中的特殊符号总结
在shell中常用的特殊符号罗列如下: # ; ;; . , / \\ 'string'| ! $ ${} $? $$ $* \"string\"* ** ...
- three.js是什么,能干嘛,和webgl什么关系
如今浏览器的功能越来越强大,而且这些功能可能通过JavaScript直接调用.你可以用HTML5标签轻松地添加音频和视频,而且可以在HTML5画布上创建各种交互组件.现在这个功能集合里又有了一个新成员 ...
- Es官方文档整理-2.分片内部原理
Es官方文档整理-2.分片内部原理 1.集群 一个运行的Elasticsearch实例被称为一个节点,而集群是有一个或多个拥有相同claster.name配置的节点组成,他们共同承担数据和负 ...
- luogu P1126 机器人搬重物 题解
luogu P1126 机器人搬重物 题解 题目描述 机器人移动学会(\(RMI\))现在正尝试用机器人搬运物品.机器人的形状是一个直径\(1.6\)米的球.在试验阶段,机器人被用于在一个储藏室中搬运 ...
- mongo体系架构学习
MongoDB是一个可移植的数据库,它在流行的每一个平台上都可以使用,即所谓的跨平台性,在不同的操作系统上虽然略有差别,但是从整体架构上来看,MongoDB在不同的平台上是一样的,如数据逻辑结构和数据 ...
- PHP递归遍历数组 不破坏数据结构 替换字符
代码如下: <?php $arr = array('0'=>array("<小刚>","<小晓>","<小飞 ...
- GMM与EM算法
用EM算法估计GMM模型参数 参考 西瓜书 再看下算法流程
- USACO 4.4 Shuttle Puzzle
Shuttle PuzzleTraditional The Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, ...
- 黑马程序员_java基础笔记(07)...IO流
—————————— ASP.Net+Android+IOS开发..Net培训.期待与您交流!—————————— IO(InputStream,outputStream)字节流 (Reader,Wr ...
- 人工智能我见及特征提取mfcc算法理解
一.人工智能 从LeNex手写数字识别,AlexNet图像识别,到无人驾驶汽车,再到Alpha Go.Alpha Go Zero的横空出世,人工智能无疑已经成为了当下科技的大热.那么什么是人工智能呢? ...