分类 电脑 下的文章

cPanel - WHM - 为apache2新增模块 - mod_version - Invalid command '<IfVersion'

问题:迁移magento2站点后,访问首页,提示500错误,apache2错误日志里有此类错误信息:.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by

尝试:WHM -> EasyApache 4 --> Apache Modules ---> 选上 mod_version

cpanel-apache-modules-version.png

参考:https://stackoverflow.com/questions/51743921/magento-ifversion-perhaps-misspelled-or-defined-by-a-module-not-included-in-t

magento - 导入图片 - 图片目录设置 - Images File Directory - pub/media/import

问题:magento2后台,导入商品时,检查有效,但结果失败:Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1, 37

尝试:设置图片目录里,如果图片已经上传到服务器的pub/media/productpics目录里,请填写:pub/media/productpics (不用/打头)。

magento-import-images-directory-1.png

参考:https://magento.stackexchange.com/questions/109066/magento-2-product-import-wont-import-images

magento1.x - CSS文件加载失败 - 禁用 SELinux

现象:重装CentOS系统后,迁回magento1.x的站点,打开网页时,格局错乱,很多.js和CSS文件提示403拒绝访问。

过程:

1.查看Web日志,有如这样的错误信息:[access_compat:error] [pid 13908] [client 220.243.135.218:61156] AH01797: client denied by server configuration: /var/www/sites/chinastonejewelry/var/www

2.setenforce 0 # 立即禁用SELinux功能,如果需彻底关闭,请更改 /etc/selinux/config 里的值

参考:https://docs.iredmail.org/install.iredmail.on.rhel.html#disable-selinux

monicahq - 修复图片链接路径 - php artisan storage:link

现象:在monica里,可以上传图片,但不会显示。从浏览器里直接访问图片URL,提示404未找到。如:/storage/photos/h4DBeuTT03p35n8z5tRcYUatnWIstfp1bZNA6MPH.jpeg

过程:

1.查看路径/storage/app/public/photos/里有新上传的图片,但/public/storage/photos里没有

2.删除或改名/public/storage/

3.php artisan storage:link #运行管理命令,重新创建软链接 /public/storage/ 到 /storage/app/public/

monica-storeage-linkpng.png

参考:https://github.com/monicahq/monica/issues/702