Resolved Can't upload files

Status
Not open for further replies.

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
Can't upload files. Gaves me 500 error when complete the proccess
Everything was working fine like a week ago. Now it's broken
 

bsbgrbsh

New Member
Messages
15
Reaction score
0
Points
1
Do you have free space available? When you go over the storage limit it stops you being able to upload, but website still works as normal.
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
Do you have free space available? When you go over the storage limit it stops you being able to upload, but website still works as normal.
Yeah I have space. I have deleted some files cause I thought of that before but still the same.
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
How are you uploading the files? What size, approximately, is the file(s) you are attempting to upload?
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
How are you uploading the files? What size, approximately, is the file(s) you are attempting to upload?
Just images less than 5MB or 4MB. Everything was okay before. Didn't touch anything tho
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
What errors are you getting? Check your error log in DirectAdmin.
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
What errors are you getting? Check your error log in DirectAdmin.
It gives me no error related with my php script. I just get a 500 error status once the file is uploaded.
The only thing I can see is this:
Undefined index: LS_AI_MIME_TYPE in /usr/local/lsws/share/autoindex/default.php
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
You may have to turn on error reporting in your PHP script. Find the first <?php in the file, then put this right after

Code:
error_reporting(-1); // turn on all errors

So it should be <?php, then that code is on the next line
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
You may have to turn on error reporting in your PHP script. Find the first <?php in the file, then put this right after

Code:
error_reporting(-1); // turn on all errors

So it should be <?php, then that code is on the next line
Yeah, I already have it like this error_reporting(E_ALL) but after changing it, it says json_encode() is undefined... so wtf?? lol
Did you change something on PHP??
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
You are in full control to set your PHP to whatever you'd like through DirectAdmin. Make sure the one you have selected has the JSON extension enabled.

I'm requesting an admin verifies JSON is enabled on the native version
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
JSON is enabled in native mode.

However with changing php version, it is up to the user to pick out extensions needed.
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
You are in full control to set your PHP to whatever you'd like through DirectAdmin. Make sure the one you have selected has the JSON extension enabled.

I'm requesting an admin verifies JSON is enabled on the native version
It's already enabled. I disabled it and enabled again but nothing happens
 

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
You are in full control to set your PHP to whatever you'd like through DirectAdmin. Make sure the one you have selected has the JSON extension enabled.

I'm requesting an admin verifies JSON is enabled on the native version
even functions like imagecreatefromjpeg() are undefined :/
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
What version are you using? Can you try using the native PHP?
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Can you put this text in a file in your public_html and then go to it?

test.php:
Code:
<?php var_dump(function_exists('json_encode')); ?>

It works for me, showing that json_encode() exists. I'm using native PHP. http://gjr.x10.mx/test.php
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I'm just showing the function exists. Even if the function is called wrong, that's a different error message than function undefined.

I'm thinking there's something to do with PHP versions. Have you tried using 5.x instead of 7? Maybe namespacing is hiding normal functions?

edit:
check output of phpinfo()

PHP native has JSON enabled and it's not on the list of disabled functions.

Code:
exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
 
Last edited:

yuyisx10

New Member
Messages
20
Reaction score
0
Points
1
Ok, i'm gonna try that...
Yeah, it worked with version 5.6
What's going on? I've been using version 7.2 without any issue until now. So weeeeird
 
Status
Not open for further replies.
Top