Legacy Archive (2015): Originally written in Chinese on doubixie.com and translated into English for this edition. All archive posts · Home

Discuz! X3 Portal Revamp Guide #2: Remote Image Localization Issues

Original Chinese title: discuz x3 门户改造手册2-图片本地的问题

  • I used a remote-image localization plugin whose main job is to automatically download external images in content pages and store them locally. When batch-saving, however, it kept hitting a 504 nginx timeout.

  • My first thought was FastCGI. After tweaking the parameters, the 504 error went away, yet none of the images were actually saved. So it wasn’t a FastCGI issue.

  • This stumped me for a few days. I SSH’d in to check the directories—image folders are named by date—and suddenly noticed that not even the folder for the localized images had been created.

    ls -l
  • That’s when I saw the image storage directory was owned by root:root, while my www user was nginx:nginx. No wonder.

    chmod -R nginx:ginx /
    chmod -R 777 /
  • Good old 777 saves the day again (lol). Still, it’s weird that the PHP script ran without throwing any errors or warnings—probably because PHP error reporting was turned off in production.

  • Pretty much it.

  • Testing an image host

[Archived image unavailable in 2013–2019 mirror: http://www.doubixie.com/images/st0-452.jpg]