JoeGandy / ShareX-Custom-Upload

A little PHP script created for uploading custom sharex files to your own webserver
MIT License
166 stars 50 forks source link

URL is empty #44

Closed g0dzcsgo closed 5 years ago

g0dzcsgo commented 5 years ago

Im having issues making this work, i had a working one of these before... but now i have reset my computer.. and now i can't seem to get it to work... i've done the exact same thing 1:1 i did before..

But now it just throws me the error URL is empty...? did sharex add something new you gotta add?

IMG: 111

Also, i wanna add i cannot get gallery to work... i've allowed all ips (no luck) and i've allowed my ip (no luck) anyway.

JoeGandy commented 5 years ago

Hi,

I'm sure we can fix this stuff, I'd recommend making sure you have the latest codebase on master, then re-follow the main setup instructions as it now includes a config auto generator.

It looks like you're on a old version of shareX too, so update that to the latest. An example config screen is here: 07 07 05-25 07 19 1

g0dzcsgo commented 5 years ago

Did as you said, still same error.... :/

IMG: image

JoeGandy commented 5 years ago

Could I have a look at your config.php? Just hide out any sensitive info and leave the ends of urls visible :)

g0dzcsgo commented 5 years ago

Here. image

JoeGandy commented 5 years ago

That all looks fine, I would check these thing in order:

g0dzcsgo commented 5 years ago

I do not use nginx, i use cpanel.

Write perms are 777 on the /u/ directory.

My https is working correctly and is setup.

and ill try the https thing now

g0dzcsgo commented 5 years ago

HTTPs thing did not work.

g0dzcsgo commented 5 years ago

image

g0dzcsgo commented 5 years ago

Hello World did work correctly, and printed "Hello World", I even tried to swap all urls to http instead, still no luck... don't even know what "URL is empty" means... :/

JoeGandy commented 5 years ago

Hey, The error 'URL is empty' is an error from ShareX, it does this when it sends a post request but gets nothing back. This is usually an error on the server side.

I'm not familiar with cPanel, can you check for an error log or something?

The default apache error logs are here: /var/log/apache2/error.log.

nginx error logs are here: /var/log/nginx/nginx_error.log or here: /var/log/nginx/error.log

apache/nginx are the HTTP servers, one of these will be running your website, I'm not sure how familiar you are with this stuff so apologies if i sound patronising! :)

g0dzcsgo commented 5 years ago

maybe i have done something wrong then.... cuz it's worked on this host before so... :/

JoeGandy commented 5 years ago

I'm sure its something minor, or even a mistake with the latest release, If we can track down the error in the logs, it'll tell us whats going on!

JoeGandy commented 5 years ago

I've found this:

https://www.liquidweb.com/kb/locations-of-common-log-files-on-cpanel-servers/

Which might be helpful for finding the error log

g0dzcsgo commented 5 years ago

I tried on another ftp server not hosted by the same company, and now it is actually giving no error, but not uploading any image, but instead providing a bunch of html code.

g0dzcsgo commented 5 years ago

image

g0dzcsgo commented 5 years ago

image

JoeGandy commented 5 years ago

Looks like you're being redirected back to the homepage, this only happens when the key passed into the post doesn't exists, or doesn't match the 'secure_key' in your config file

g0dzcsgo commented 5 years ago

I downloaded the file provided on the url /u/ directory image

But its returning HTML code....?

g0dzcsgo commented 5 years ago

It should match, i downloaded the file from the /u/ directory??

JoeGandy commented 5 years ago

In your config.php, swap out the 'http' for 'https' as I see on your site you have it forced https, this is the fix I said we need to look into :)

g0dzcsgo commented 5 years ago

Yep works, still my other domain doesn't work which is sad....

g0dzcsgo commented 5 years ago

And i wonder what the issue is, since it's worked before on there :/

JoeGandy commented 5 years ago

Were you able to locate the error log? As that will give us a clear picture?

g0dzcsgo commented 5 years ago

I don't have access to it unfortunately.

g0dzcsgo commented 5 years ago

It's shared hosting.

DJkikisa commented 5 years ago

All shared hostings normally when you open FTP has logs folder or on many cpanel hostings has in your main webpage folder error_log file(just checked 2 different cpanel hosts and had in my webpage folder inside)

g0dzcsgo commented 5 years ago

I do not have any error_log

JoeGandy commented 5 years ago

I don't think there is much we can do then, I'd get a ticket into cpanel and ask them where you can find it. If you get the error then come back here I'm sure we can help you out.

There will be some kind of error log, might be in the GUI somewhere.

g0dzcsgo commented 5 years ago

Ok.

JoeGandy commented 5 years ago

Feel free to reopen if you get more info