[GH-ISSUE #82] File not found. #62

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

Originally created by @feruzm on GitHub (Jan 5, 2019).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/82

Any idea what might have caused this? I am on v2

Originally created by @feruzm on GitHub (Jan 5, 2019). Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/82 Any idea what might have caused this? I am on v2
kerem closed this issue 2026-02-25 23:40:33 +03:00
Author
Owner

@geek-at commented on GitHub (Jan 5, 2019):

Any errors in your log?

<!-- gh-comment-id:451699028 --> @geek-at commented on GitHub (Jan 5, 2019): Any errors in your log?
Author
Owner

@feruzm commented on GitHub (Jan 6, 2019):

yes, here is example of log from nginx error.log

2019/01/05 20:34:15 [error] 28932#28932: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: x.x.x.x, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "example.com"

<!-- gh-comment-id:451725526 --> @feruzm commented on GitHub (Jan 6, 2019): yes, here is example of log from nginx error.log ```2019/01/05 20:34:15 [error] 28932#28932: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: x.x.x.x, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "example.com"```
Author
Owner

@geek-at commented on GitHub (Jan 6, 2019):

Seems like your nginx config has an error. Check this Stack overflow post about that problem

<!-- gh-comment-id:451764467 --> @geek-at commented on GitHub (Jan 6, 2019): Seems like your nginx config has an error. Check [this Stack overflow post](https://serverfault.com/questions/517190/nginx-1-fastcgi-sent-in-stderr-primary-script-unknown) about that problem
Author
Owner

@feruzm commented on GitHub (Jan 6, 2019):

looks like having folder in /root/pictshare causes above issue, moved into /var/www/pictshare now seeing 404 when loading page.

<!-- gh-comment-id:451765456 --> @feruzm commented on GitHub (Jan 6, 2019): looks like having folder in `/root/pictshare` causes above issue, moved into `/var/www/pictshare` now seeing 404 when loading page.
Author
Owner

@feruzm commented on GitHub (Jan 6, 2019):

Tried with api/upload:
mp4, gif, jpg, png
mp4 - 500 internal server error
jpg - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"}
png - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"}
gif - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"}

2019/01/06 20:05:51 [error] 12785#12785: *14 FastCGI sent in stderr: "PHP message: PHP Warning:  fopen(/var/www/pictshare/api/../data/sha1.csv): failed to open stream: No such file or directory in /var/www/pictshare/inc/core.php on line 360
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function mb_strlen() in /var/www/pictshare/inc/core.php:313
Stack trace:
#0 /var/www/pictshare/inc/core.php(124): getRandomString(6)
#1 /var/www/pictshare/content-controllers/video/video.controller.php(67): getNewHash('mp4', 6)
#2 /var/www/pictshare/api/upload.php(53): VideoController->handleUpload('/tmp/phpAwMZii', false)
#3 {main}
  thrown in /var/www/pictshare/inc/core.php on line 313" while reading response header from upstream, client: xxx.xx.x.x, server: example.com, request: "POST /api/upload.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "example.com"
<!-- gh-comment-id:451766137 --> @feruzm commented on GitHub (Jan 6, 2019): Tried with api/upload: `mp4`, `gif`, `jpg`, `png` mp4 - 500 internal server error jpg - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"} png - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"} gif - {"status":"err","reason":"Unsupported filetype: octet-stream","filetype":"octet-stream"} ``` 2019/01/06 20:05:51 [error] 12785#12785: *14 FastCGI sent in stderr: "PHP message: PHP Warning: fopen(/var/www/pictshare/api/../data/sha1.csv): failed to open stream: No such file or directory in /var/www/pictshare/inc/core.php on line 360 PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/pictshare/inc/core.php:313 Stack trace: #0 /var/www/pictshare/inc/core.php(124): getRandomString(6) #1 /var/www/pictshare/content-controllers/video/video.controller.php(67): getNewHash('mp4', 6) #2 /var/www/pictshare/api/upload.php(53): VideoController->handleUpload('/tmp/phpAwMZii', false) #3 {main} thrown in /var/www/pictshare/inc/core.php on line 313" while reading response header from upstream, client: xxx.xx.x.x, server: example.com, request: "POST /api/upload.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "example.com" ```
Author
Owner

@feruzm commented on GitHub (Jan 6, 2019):

content of config.inc

<?php 
/**
 * All settings that are uncommented are mandatory
 * Others optional
 */
define('URL','https://example.com/');
define('UPLOAD_FORM_LOCATION', 'secret/upload');
define('ALLOW_BLOATING', false);
define('ALT_FOLDER','/home/');
define('LOG_UPLOADER', true);
define('UPLOAD_CODE', 'xxx');
define('TITLE', 'eSteem Media');
define('MASTER_DELETE_CODE', 'yyyyy');
define('MASTER_DELETE_IP', 'xxx');
// PNG level from 0 (largest file) to 
// 9 (smallest file). Note that this doesn't affect
// quality, only file size and CPU
define('PNG_COMPRESSION', 6);
// JPG compression percenage from 0 (smallest file, worst quality) 
// to 100 (large file, best quality)
define('JPEG_COMPRESSION', 90);
<!-- gh-comment-id:451766490 --> @feruzm commented on GitHub (Jan 6, 2019): content of config.inc ``` <?php /** * All settings that are uncommented are mandatory * Others optional */ define('URL','https://example.com/'); define('UPLOAD_FORM_LOCATION', 'secret/upload'); define('ALLOW_BLOATING', false); define('ALT_FOLDER','/home/'); define('LOG_UPLOADER', true); define('UPLOAD_CODE', 'xxx'); define('TITLE', 'eSteem Media'); define('MASTER_DELETE_CODE', 'yyyyy'); define('MASTER_DELETE_IP', 'xxx'); // PNG level from 0 (largest file) to // 9 (smallest file). Note that this doesn't affect // quality, only file size and CPU define('PNG_COMPRESSION', 6); // JPG compression percenage from 0 (smallest file, worst quality) // to 100 (large file, best quality) define('JPEG_COMPRESSION', 90); ```
Author
Owner

@geek-at commented on GitHub (Jan 7, 2019):

What linux are you running?

For the mb_string error see the install guide because you need the multibyte package of php

<!-- gh-comment-id:451958127 --> @geek-at commented on GitHub (Jan 7, 2019): What linux are you running? For the mb_string error see [the install guide](https://github.com/HaschekSolutions/pictshare/blob/master/rtfm/INSTALL.md) because you need the multibyte package of php
Author
Owner

@feruzm commented on GitHub (Jan 7, 2019):

Ubuntu 18.04.1 LTS

<!-- gh-comment-id:452024053 --> @feruzm commented on GitHub (Jan 7, 2019): Ubuntu 18.04.1 LTS
Author
Owner

@feruzm commented on GitHub (Jan 7, 2019):

installing all php packages fixed upload via api but home page and and secret upload page shows 404.

<!-- gh-comment-id:452032751 --> @feruzm commented on GitHub (Jan 7, 2019): installing all php packages fixed upload via api but home page and and secret upload page shows 404.
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#62
No description provided.