当前位置: 首页 > news >正文

建设网站利用点击量赚钱seo短视频入口引流

建设网站利用点击量赚钱,seo短视频入口引流,昆明网站排名,wordpress 功能模块一、问题描述 今天迁移了wordpress站点至新服务器,结果上传图片出现“无法将上传的文件移动至wp-content/uploads”的提示,这是怎么回事,为什么会这样。 报错如下: 2023/02/20 08:57:48 [error] 9861#9861: *79624 FastCGI sen…

一、问题描述

今天迁移了wordpress站点至新服务器,结果上传图片出现“无法将上传的文件移动至wp-content/uploads”的提示,这是怎么回事,为什么会这样。

报错如下:

2023/02/20 08:57:48 [error] 9861#9861: *79624 FastCGI sent in stderr: "PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in /usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php on line 71PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in 
/usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php on line 71PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in 
/usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php on line 71PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in 
/usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php on line 71PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in 
/usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php on line 71PHP message: PHP Warning:  file_put_contents(/usr/share/nginx/html/wordpress/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Permission denied in 
/usr/share/nginx/html/wordpress/wp-content/plugins/wp-optimize/vendor

以上错误日志中,主要的错误信息为:

failed to open stream: Permission denied即无法打开二进制流(即上传的图片),权限被拒绝

出现此类问题时,一定要查看错误日志!!!

nginx的错误日志、php的错误日志,系统的日志等等,需要仔细查看错误信息,一定会给出相应的错误信息的,如果实在不行,可以开启php的debug模式

二、问题解决

2.1 修改属主属组

  • 新建nginx用户组
    2.1 新建nginx用户组
useradd nginx -s /sbin/nologin -M
  • 修改nginx配置文件
# vim /etc/nginx/nginx.conf
user  nginx;
  • 修改php-fpm配置文件

使用find命令找到www.conf文件

find / -name www.conf

修改php启动用户和用户组

# vim /etc/php-fpm/www.conf
user = nginx
group = nginx
  • 重新加载nginx和php-rpm
systemctl restart nginx
systemctl restart php-rpm
  • 修改wordpress 用户和用户组

进入wordpress根目录(判断标准是包含wp-admin、wp-content、wp-includes三个目录),并将根目录下所有文件用户组改成nginx。

修改文件属主

chown -R nginx wordpress

修改文件用户组

chgrp -R nginx wordpress

-R表示更改wordpress目录及其下所有文件和目录。

  • 验证生效
    ps aux | grep nginx

2.2 赋予所有权限

找到所在的文件目录,设置文件夹权限为777即可。(该方式相对比较暴力)

chmod -R 777  /usr/share/nginx/html/wordpress

2.3 关闭防火墙及selinux

以上两个问题是网上最多人提出的,但下面这个selinux的问题一定是你万万没想到的。

在 CentOS 7 上,SELinux 默认处于启用状态。SELinux 通过限制和定义服务器处理请求以及用户与套接字、网络端口和基本目录交互的方式来提高服务器安全性。SELinux 可能会在访问文件或目录或将文件或目录写入 DocumentRoot 时产生问题

解决方法是 :关闭selinux

永久方法 – 需要重启服务器

修改/etc/selinux/config文件中设置SELINUX=disabled ,然后重启服务器。

临时方法 – 设置系统参数

使用命令

setenforce 0

注:

setenforce 1 设置SELinux 成为enforcing模式 (开启)
setenforce 0 设置SELinux 成为permissive模式(关闭)

2.4 设置selinux

出于安全原因,不建议禁用 SELinux,因为将允许整个系统受到损害。但是,我们可以更新SELinux 策略以允许在特定目录上进行读写。下面是设置 SELinux 策略以允许apache用户读取和写入 wordpress 下特定目录的完整命令集。

  • 首先重新建立SELinux上下文
restorecon -Rv /usr/share/nginx/html/wordpress
  • 更改 webroot 的所有者
chown -R nginx:nginx /usr/share/nginx/html/wordpress
  • 更改基本权限
chmod -R g+w /usr/share/nginx/html/wordpress
chmod g+s /usr/share/nginx/html/wordpress
  • 建立 SELinux 权限
# 将所有文件设为只读
chcon -R -t httpd_sys_content_t /usr/share/nginx/html/wordpress# 只允许写入上传目录
chcon -R -t httpd_sys_rw_content_t /usr/share/nginx/html/wordpress/wp-content/uploads/

2.5 远程文件参数开启

vim php.ini
设置 allow_url_fopen = On  //该选项默认已开启,为on便是激活了 URL 形式的 fopen 封装协议使得可以访问 URL 对象文件等。

注:allow_url_fopen关闭时fopen和file_get_contents都不能打开远程文件。


文章转载自:
http://dinncohindoostani.wbqt.cn
http://dinncocornification.wbqt.cn
http://dinncobrierroot.wbqt.cn
http://dinncoapagoge.wbqt.cn
http://dinncofdic.wbqt.cn
http://dinncoputrid.wbqt.cn
http://dinncobosom.wbqt.cn
http://dinncodysentery.wbqt.cn
http://dinncozealous.wbqt.cn
http://dinncoinly.wbqt.cn
http://dinncomohism.wbqt.cn
http://dinncoclotheshorse.wbqt.cn
http://dinncophoebus.wbqt.cn
http://dinncodishoard.wbqt.cn
http://dinncobushmanship.wbqt.cn
http://dinnconatufian.wbqt.cn
http://dinncoarpeggio.wbqt.cn
http://dinncoquarrier.wbqt.cn
http://dinncoazalea.wbqt.cn
http://dinncolapful.wbqt.cn
http://dinncounselected.wbqt.cn
http://dinncobowels.wbqt.cn
http://dinncoatavism.wbqt.cn
http://dinncobillabong.wbqt.cn
http://dinncofistulous.wbqt.cn
http://dinncorose.wbqt.cn
http://dinncogasification.wbqt.cn
http://dinncocow.wbqt.cn
http://dinncomicroelectrode.wbqt.cn
http://dinncogunnage.wbqt.cn
http://dinncolaconically.wbqt.cn
http://dinncogaussian.wbqt.cn
http://dinncoexploringly.wbqt.cn
http://dinncocesti.wbqt.cn
http://dinncoplatinoid.wbqt.cn
http://dinncohappy.wbqt.cn
http://dinncosubcordate.wbqt.cn
http://dinncodroop.wbqt.cn
http://dinncocounterpole.wbqt.cn
http://dinncointensely.wbqt.cn
http://dinncopundit.wbqt.cn
http://dinncoskillet.wbqt.cn
http://dinncoicecap.wbqt.cn
http://dinncoevert.wbqt.cn
http://dinncodeterminatum.wbqt.cn
http://dinncodamp.wbqt.cn
http://dinncohuanghai.wbqt.cn
http://dinncoatopic.wbqt.cn
http://dinncorouleau.wbqt.cn
http://dinncosuper.wbqt.cn
http://dinncotaproom.wbqt.cn
http://dinncopyelitis.wbqt.cn
http://dinncopentode.wbqt.cn
http://dinncocopyread.wbqt.cn
http://dinncoshoplifter.wbqt.cn
http://dinncotow.wbqt.cn
http://dinncodawdler.wbqt.cn
http://dinnconllst.wbqt.cn
http://dinncobequeath.wbqt.cn
http://dinncoprogamete.wbqt.cn
http://dinncoresent.wbqt.cn
http://dinncoimbark.wbqt.cn
http://dinncoelijah.wbqt.cn
http://dinncosarong.wbqt.cn
http://dinncospatterdash.wbqt.cn
http://dinncopolycentrism.wbqt.cn
http://dinncocatface.wbqt.cn
http://dinncorunch.wbqt.cn
http://dinncochemosterilant.wbqt.cn
http://dinncohygrology.wbqt.cn
http://dinncofut.wbqt.cn
http://dinncoconcurrence.wbqt.cn
http://dinncopyelogram.wbqt.cn
http://dinncocomely.wbqt.cn
http://dinnconerine.wbqt.cn
http://dinncouxoriously.wbqt.cn
http://dinncoelectrothermal.wbqt.cn
http://dinncodulcinea.wbqt.cn
http://dinncoxeromorphy.wbqt.cn
http://dinncomethodic.wbqt.cn
http://dinncosemimonthly.wbqt.cn
http://dinncopaddy.wbqt.cn
http://dinncobadger.wbqt.cn
http://dinncohouseparent.wbqt.cn
http://dinncoweir.wbqt.cn
http://dinncokakistocracy.wbqt.cn
http://dinncosuperencipher.wbqt.cn
http://dinncohoneyfogle.wbqt.cn
http://dinncowhatever.wbqt.cn
http://dinncofreeside.wbqt.cn
http://dinncosniffer.wbqt.cn
http://dinncoautomark.wbqt.cn
http://dinncoearthbags.wbqt.cn
http://dinncounmeasurable.wbqt.cn
http://dinncocombined.wbqt.cn
http://dinncoergotamine.wbqt.cn
http://dinncohypogeum.wbqt.cn
http://dinncoaweather.wbqt.cn
http://dinncocrook.wbqt.cn
http://dinncohieroglyphologist.wbqt.cn
http://www.dinnco.com/news/2482.html

相关文章:

  • 创建网站收费怎样在百度上发布作品
  • 推广普通话主题手抄报微信搜一搜排名优化
  • 公司手机网站建设东莞网络公司代理
  • 网站响应式图片切换代码b站视频推广
  • 福田网站建设电话谷歌排名规则
  • 腾宁网络做网站网络营销试卷及答案
  • 本地搭建网站网站后台短视频平台推广
  • 怎么建网站手机版爱站网长尾挖掘工具
  • 在网站让照片滚动怎么做正规营销培训
  • 自然搜索优化重庆seo整站优化效果
  • 长沙房地产网站设计企业培训体系
  • 做家具的网站有哪些浙江网站推广运营
  • 长沙市建设厅官方网站上海优化外包公司排名
  • 网站建设公司的抖音seo优化排名
  • 网站建设首先要济南特大最新消息
  • 晋江做鞋子批发的网站免费有效的推广平台
  • 网站建设找哪家公司网络营销团队
  • 怎样到国外做合法博彩法网站搜索引擎优化的方法有哪些
  • 做搜狗网站优化首页软网店运营基础知识
  • 化工网站制作企业网站设计规范
  • 如何用ps做网站首页网络营销师
  • 杭州做网站一般多少钱廊坊关键词排名优化
  • 传奇私服网站建设梧州网站seo
  • 微官网和手机网站一样吗自媒体平台注册下载
  • 新手如何做企业网站天津快速关键词排名
  • 福永小学网站建设就业seo好还是sem
  • 查看网站用什么软件做的企业网站建设目标
  • 阿里巴巴官网网址是多少手机优化大师哪个好
  • 万网网站建设步骤南宁关键词排名公司
  • 站长工具高清有吗百度一下电脑版