[GH-ISSUE #34] Can't show pictures after uploading #27

Closed
opened 2026-02-25 23:40:26 +03:00 by kerem · 5 comments
Owner

Originally created by @seuplus on GitHub (Jun 21, 2017).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/34

Sir. I like pictshare very much. But I failed many times when I tried to install it on my VPS (CentOS 7 & LNMP). I can find the picture in upload folder after I upload picture 001.jpg like this

- upload
  - 001.jpg
    - 001.jpg

But it can't show after finishing uploading. https://img.muzi.moe
Hope to get your helps. Thank you!
Screen Shot 2017-06-21 at 16.45.40.png

Originally created by @seuplus on GitHub (Jun 21, 2017). Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/34 Sir. I like pictshare very much. But I failed many times when I tried to install it on my VPS (CentOS 7 & LNMP). I can find the picture in `upload` folder after I upload picture `001.jpg` like this ``` - upload - 001.jpg - 001.jpg ``` But it can't show after finishing uploading. https://img.muzi.moe Hope to get your helps. Thank you! ![Screen Shot 2017-06-21 at 16.45.40.png](https://ooo.0o0.ooo/2017/06/21/594a325bb74b1.png)
kerem closed this issue 2026-02-25 23:40:26 +03:00
Author
Owner

@geek-at commented on GitHub (Jun 21, 2017):

do you have the graphicslibrary php-gd installed?

<!-- gh-comment-id:310023451 --> @geek-at commented on GitHub (Jun 21, 2017): do you have the graphicslibrary php-gd installed?
Author
Owner

@seuplus commented on GitHub (Jun 21, 2017):

yum install php-gd
Package php-gd-5.4.16-42.el7.x86_64 already installed and latest version

Yes, Sir. I have had php-gd installed on CentOS and added rewrite rules to nginx conf. But it didn't work.

location / {
     try_files $uri $uri/ /index.php?url=$request_uri; # instead of htaccess mod_rewrite
}

I tried to install pictshare in LAMP and it succeed showing pictures after chmod -R 777 upload.

PS:
Nginx: https://img.muzi.moe Apache: https://***.muzi.moe

And my nginx conf:

server {
  listen 80;
  listen 443 ssl http2;
  ssl_certificate /usr/local/nginx/conf/ssl/img.muzi.moe.crt;
  ssl_certificate_key /usr/local/nginx/conf/ssl/img.muzi.moe.key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers on;
  ssl_session_timeout 10m;
  ssl_session_cache builtin:1000 shared:SSL:10m;
  ssl_buffer_size 1400;
  add_header Strict-Transport-Security max-age=15768000;
  ssl_stapling on;
  ssl_stapling_verify on;
  server_name img.muzi.moe;
  access_log off;
  index index.php;
  root /data/wwwroot/img.muzi.moe;
  if ($ssl_protocol = "") { return 301 https://$server_name$request_uri; }
  
  location / {
      try_files $uri $uri/ /index.php?url=$request_uri;
  }
  
  location ~ [^/]\.php(/|$) {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
  }

  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    expires 30d;
    access_log off;
  }
  location ~ .*\.(js|css)?$ {
    expires 7d;
    access_log off;
  }
  location ~ /\.ht {
    deny all;
  }
}
<!-- gh-comment-id:310036642 --> @seuplus commented on GitHub (Jun 21, 2017): `yum install php-gd` `Package php-gd-5.4.16-42.el7.x86_64 already installed and latest version` Yes, Sir. I have had `php-gd` installed on CentOS and added rewrite rules to nginx conf. But it didn't work. ``` location / { try_files $uri $uri/ /index.php?url=$request_uri; # instead of htaccess mod_rewrite } ``` I tried to install pictshare in LAMP and it succeed showing pictures after `chmod -R 777 upload`. PS: Nginx: https://img.muzi.moe Apache: https://***.muzi.moe And my `nginx conf`: ``` server { listen 80; listen 443 ssl http2; ssl_certificate /usr/local/nginx/conf/ssl/img.muzi.moe.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/img.muzi.moe.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_timeout 10m; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_buffer_size 1400; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; server_name img.muzi.moe; access_log off; index index.php; root /data/wwwroot/img.muzi.moe; if ($ssl_protocol = "") { return 301 https://$server_name$request_uri; } location / { try_files $uri $uri/ /index.php?url=$request_uri; } location ~ [^/]\.php(/|$) { #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { expires 30d; access_log off; } location ~ .*\.(js|css)?$ { expires 7d; access_log off; } location ~ /\.ht { deny all; } } ```
Author
Owner

@geek-at commented on GitHub (Jun 21, 2017):

Okay it seems like you have a problem with your nginx configuration but it seems good to me

<!-- gh-comment-id:310093377 --> @geek-at commented on GitHub (Jun 21, 2017): Okay it seems like you have a problem with your nginx configuration but it seems good to me
Author
Owner

@geek-at commented on GitHub (Jun 21, 2017):

interestingly it only has a problem with .jpg files since https://img.muzi.moe/xx/xx works but https://img.muzi.moe/xx/xx.jpg doesn't

<!-- gh-comment-id:310093693 --> @geek-at commented on GitHub (Jun 21, 2017): interestingly it only has a problem with .jpg files since https://img.muzi.moe/xx/xx works but https://img.muzi.moe/xx/xx.jpg doesn't
Author
Owner

@seuplus commented on GitHub (Jun 21, 2017):

Thanks for your replies. Sir.
I'm not familiar with Nginx very much. So I'm intended to use pictshare on LAMP for the moment.

<!-- gh-comment-id:310115341 --> @seuplus commented on GitHub (Jun 21, 2017): Thanks for your replies. Sir. I'm not familiar with Nginx very much. So I'm intended to use pictshare on LAMP for the moment.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pictshare#27
No description provided.