阿里云安装wordpress遇到的问题
在阿里云服务器上安装Nginx,php5.3.3环境,使用阿里云的RDS数据库
1,安装wordpress,提示您的PHP似乎没有安装运行WordPress所必需的MySQL扩展
解决方案:移除已经安装的php环境 yum remove php
重新安装: yum install php lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap
php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap
php-tidy php-common php-devel php-fpm
2,安装插件,提示:无法建立目录 wp-content/uploads/2015/01。
把wp-content这个文件夹的权限也改成777
3,上传插件后,提示:要执行请求的操作,WordPress 需要访问您网页服务器的权限。要求输入一堆ftp密码
在wp-config.php里加入下面代码:
define("FS_METHOD","direct");
define("FS_CHMOD_DIR",0777);
define("FS_CHMOD_FILE",0777);
把plugins及themes权限改为0777 4,安装CKEditor插件后没有中文字体
修改wordpress/wp-content/plugins/ckeditor-for-wordpress下面的ckeditor.config.js
中增加图中所示代码

config.font_names
= '宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+
安装后,刷新后台,即可看到中文字体
5,截取文章摘要
使用php的mb_strimwidth。需要安装插件。centos可以使用yum安装
yum -y install php-mbstrin
安装之后重启php-fpm,nginx
截取文章方法:
/**
* 截取文章摘要
*/
function cutArticle($data,$cut=0,$str="....")
{ $data=strip_tags($data);//去除html标记
$pattern = "/&[a-zA-Z]+;/";//去除特殊符号
$data=preg_replace($pattern,'',$data);
if(!is_numeric($cut))
return $data;
if($cut>0)
$data=mb_strimwidth($data,0,$cut,$str); return $data;
}
部署到阿里云上之后发现文章摘要乱码:
可以增加编码设置,解决
/**
* 截取文章摘要
*/
function cutArticle($data,$cut=0,$str="....")
{
$data=strip_tags($data);//去除html标记
$pattern = "/&[a-zA-Z]+;/";//去除特殊符号
$data=preg_replace($pattern,'',$data);
//echo !is_numeric($cut);
if(!is_numeric($cut)){
return $data;
}
if($cut>0){
$data=mb_strimwidth($data,0,$cut,$str,"utf-8");
} return $data;
}
阿里云安装wordpress遇到的问题的更多相关文章
- 阿里云安装mysql后查看不到初始密码的解决办法
在阿里云安装mysql后用grep 'A temporary password' /var/log/mysqld.log命令查看MySQL初始密码,毛线都没有看到,然后直接到/var/log/mysq ...
- 阿里云安装Nginx+vue项目部署
阿里云安装Nginx+vue项目部署 nginx安装包下载 http://nginx.org/en/download.html nginx安装 首先先安装PCRE pcre-devel 和Zlib,因 ...
- 阿里云安装JDK1.7
本人阿里云选择的是CentOS 7.0系统,本系列文件将全部基于此环境. 1.下载JDK,版本为jdk-7u79-linux-x64.tar.gz 2.使用FileZilla上传至/softwar ...
- 阿里云安装LNMP以及更改网站文件和MySQL数据目录
LNMP安装了哪些软件?安装目录在哪LNMP相关软件安装目录Nginx 目录: /usr/local/nginx/MySQL 目录 : /usr/local/mysql/MySQL数据库所在目录:/u ...
- 阿里云安装配置mysql(centos版)
这种是利用yum下载的也可以使用xftp上传 1,安装mysql数据库 a)下载mysql源安装包:wget http://dev.mysql.com/get/mysql57-community-re ...
- 小白用阿里云搭载wordpress个人博客
阿里云服务已经购买多时,却一直没时间部署内容,借着这次机会自己照着博客园园友的方式用wordpress搭建了个人博客! 创建wordpress的内容就不多说了,直接附链接来源:https://www. ...
- 阿里云提示WordPress“/wp-includes/http.php输入IP验证不当”的解决办法
本文转自:https://www.liuzhishi.com/2931.html 标题: wordpress IP验证不当漏洞 简介: wordpress /wp-includes/http.php文 ...
- 阿里云安装kubernetes-UI报错endpoints \"kubernetes-dashboard\" not found解决方法
问题:阿里云ECS安装kube-ui v5后,访问 http://master_ip:8080/ui/跳转到http://master_ip:8080/api/v1/proxy/namespaces/ ...
- 非ECS阿里云安装插件,给阿里云云监控平台
linux的init学习: https://blog.csdn.net/kunkliu/article/details/80942279 阿里云官方文档: https://help.aliyun.co ...
随机推荐
- 转:Emmet 学习之路 - 2 基本语法
http://blog.csdn.net/jizhongchun/article/details/8472755 导读:Emmet的基本语法.学习步骤是:1 基本语法: 2 html命令: 3 css ...
- logstash安装配置
vim /usr/local/logstash/etc/hello_search.conf 输入下面: input { stdin { type => "human" }} ...
- netty最快?
http://www.techempower.com/blog/2013/04/05/frameworks-round-2/
- iOS触摸事件深入
转载自:http://www.cnblogs.com/wengzilin/p/4720550.html 概述 本文主要解析从我们的手指触摸苹果设备到最终响应事件的整个处理机制.本质上讲,整个过程可以分 ...
- fragment 数据传递,通信
Fragment之间的通信 在本节中,你会学到 1.定义接口 2.实现接口 3.将消息传递给fragment 为了重用Fragment UI 组件,在设计中你应该通过定义每一个fragemnt自己 ...
- PHP实现畅言留言板和网易跟帖样式
原文:http://justcoding.iteye.com/blog/2251192 我要实现的就是下图的这种样式,可参考下面这两个网站的留言板,他们的实现原理都是一样的 http://chan ...
- centos lvm常用命令
# vgs -a VG #PV #LV #SN Attr VSize VFree cinder 1 0 0 wz--n- 30.39g 30.39g os ...
- C#代码发送邮件
本次测试的邮箱为163邮箱 1.首相对邮箱进行一些设置(详见下图):打开设置选取客户端授权密码项,开启设置:以后在客户端登录时将使用刚刚设置的密码! 2.上干货 public static void ...
- 如何理解java的引用传递
1. 数组的引用传递 public class TestArray { public static void changeAry1(int[] ary){ int[] ary1 = {9,9,9}; ...
- ckeditor_3.6.6.2+CKFinder2.0.2配置
一.首先工具的下载,找到相应的版本进行下载 ckeditor_3.6.6.2+CKFinder2.0.2 http://ckeditor.com/download 打开war文件,然 ...