WordPress安装遇到的问题和解决方案

引言:在用centos7配置WordPress时遇到了不少问题,简单做个记录。
原博客注销,重新编辑发布。

Q1. 上传文件报错

php.ini文件中 添加:

upload_tmp_dir = /tmp

Q2. Apache服务器设置虚拟目录

  1. 打开配置文件:
vi /etc/httpd/conf/httpd.conf
  1. 在httpd.conf中添加:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
  1. 创建、配置extra/httpd-vhosts.conf:
#apache 虚拟目录配置
<VirtualHost *:80>  
    #配置访问根目录  
    DocumentRoot "/var/www/html/jsanda/"      
    ServerName anda.cc.cn   
    #这里配置欢迎首页面  
    DirectoryIndex news.html index.html index.htm index.php  
    <Directory />  
	    Options FollowSymLinks  
	    #不允许别人修改我们的页面  
	    AllowOverride None  
	    #设置访问权限  
	    Order allow,deny  
	    Allow from all  
    </Directory>  
</VirtualHost>  
#配置第二个虚拟主机  
<VirtualHost *:80>  
    #配置访问根目录
    DocumentRoot "/var/www/html"  
    ServerName *.cc.cn
    #这是给给ServerName 起别名,可以定义多个,用空格隔开
    ServerAlias blog.cc.cn pages.cc.cn
    #这里配置欢迎首页面  
    DirectoryIndex news.html index.html index.htm index.php  
    <Directory />  
    Options FollowSymLinks  
    #不允许别人修改我们的页面  
    AllowOverride None  
    #设置访问权限  
    Order allow,deny  
    Allow from all  
    </Directory>
</VirtualHost> 

Q3. 后台上传图片 提示错误

  1. 无法放入缓存:
 # 在php.ini文件中加入
upload_tmp_dir = /tmp
  1. 提示:无法创建wp-content/2018/03/
#这是WordPress目录的权限不够,注意路径要准确
chmod -R 775  wordpress/ 

#或者是当时创建者是root,而运行起来是apache这个用户;
#我们可以在目录下用 `ls -s ` 查看其它目录的权限、所有者
chown -R www:apache wordpess/ 

Q4.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值