[GH-ISSUE #116] cannot make it work on ubuntu server #442

Closed
opened 2026-02-27 12:44:32 +03:00 by kerem · 0 comments
Owner

Originally created by @ghost on GitHub (May 11, 2020).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/116

When I try to upload a file I'm getting cannot post error. Am I missing something?

curl -F "file=@/Users/apple/Desktop/dev/bethabit/marketing/logo.png" https://bethabit.com/api/upload.php


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/upload.php</pre>
</body>
</html>

this is the nginx block I use.


server {
        listen 80;
        server_name bethabit.com www.bethabit.com;

        client_max_body_size 50M; # Set the max file upload size. This needs to be equal or larger than the size you specified in your php.ini

        root /var/www/pictshare-master; # or where ever you put it
        index index.php;

    location / {
        try_files $uri $uri/ /index.php?url=$request_uri;
    }

    location ~ \.php {
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; #may be slightly different depending on your php version
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
    }

    location ~ /(data|tmp|bin|content-controllers|inc|interfaces|storage-controllers|templates|tools) {
       deny all;
       return 404;
    } 
}

this is the pictshare config


<?php 
/**
 * All settings that are uncommented are mandatory
 * Others optional
 */

//Use a specific domain for links presented to the user
//Format: https://your.domain.name/
// MUST HAVE TAILING /
define('URL','https://bethabit.com/');

//define('JPEG_COMPRESSION', 90);
//define('FFMPEG_BINARY','');
//define('ALT_FOLDER','/ftp/pictshare');
//define('ALLOWED_SUBNET','192.168.0.0/24');

//S3 settings
//
//define('S3_BUCKET','bucketname');
//define('S3_ACCESS_KEY','');
//define('S3_SECRET_KEY','');
//define('S3_ENDPOINT','http://localhost:9000'); //optional, only if you're using S3 compatible storage like Minio


Originally created by @ghost on GitHub (May 11, 2020). Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/116 When I try to upload a file I'm getting cannot post error. Am I missing something? `curl -F "file=@/Users/apple/Desktop/dev/bethabit/marketing/logo.png" https://bethabit.com/api/upload.php` ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot POST /api/upload.php</pre> </body> </html> ``` this is the nginx block I use. ``` server { listen 80; server_name bethabit.com www.bethabit.com; client_max_body_size 50M; # Set the max file upload size. This needs to be equal or larger than the size you specified in your php.ini root /var/www/pictshare-master; # or where ever you put it index index.php; location / { try_files $uri $uri/ /index.php?url=$request_uri; } location ~ \.php { fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; #may be slightly different depending on your php version fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; } location ~ /(data|tmp|bin|content-controllers|inc|interfaces|storage-controllers|templates|tools) { deny all; return 404; } } ``` this is the pictshare config ``` <?php /** * All settings that are uncommented are mandatory * Others optional */ //Use a specific domain for links presented to the user //Format: https://your.domain.name/ // MUST HAVE TAILING / define('URL','https://bethabit.com/'); //define('JPEG_COMPRESSION', 90); //define('FFMPEG_BINARY',''); //define('ALT_FOLDER','/ftp/pictshare'); //define('ALLOWED_SUBNET','192.168.0.0/24'); //S3 settings // //define('S3_BUCKET','bucketname'); //define('S3_ACCESS_KEY',''); //define('S3_SECRET_KEY',''); //define('S3_ENDPOINT','http://localhost:9000'); //optional, only if you're using S3 compatible storage like Minio ```
kerem closed this issue 2026-02-27 12:44:32 +03:00
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#442
No description provided.