A
A
Anton2016-03-22 22:55:50
PHP
Anton, 2016-03-22 22:55:50

500 internal server error after editing PHP file?

I'm working on the app. I found an error in the backend, changed the line in the php file, uploaded it, and now when requesting user / driverstatus 500 internal error. That is, before that everything worked, but there was an incorrect condition in a separate function, I changed it, now it displays an error on another one.

function driverstatus() {
        
    $iUserID = intVal($this->input->get_post("iUserID"));
    $status = $this->input->get_post('status');
    
     $sql = "UPDATE  `ridehost`.`tbl_user` SET  `onlineornot` = '$status' WHERE  `tbl_user`.`iUserID` = ".$iUserID.";";
        
        $query = $this->db->query($sql);
            
        
      $responseData['status'] = "0";

      $responseData['data'] = array();

      $responseData['message'] = "Updated Successfully";
        
        je($responseData);
        
    }

2016-03-22 22:45:05.919 Social_Event[781:340320] Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0., NSUnderlyingError=0x1a028b70 {Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x1a4c34b0> { URL: http://....amazonaws.com/ws/user/driverstatus } { status code: 500, headers {
    Connection = close;
    "Content-Length" = 1396;
    "Content-Type" = "application/json";
    Date = "Tue, 22 Mar 2016 19:43:34 GMT";
    Server = "Apache/2.4.7 (Ubuntu)";
    "X-Powered-By" = "PHP/5.5.9-1ubuntu4.14";
} }, NSErrorFailingURLKey=http://...amazonaws.com/ws/user/driverstatus, NSLocalizedDescription=Request failed: internal server error (500), com.alamofire.serialization.response.error.data=<

UPD: I noticed that before it calls driverstatus, it calls the functions from this file, I made it unavailable and it sprinkled errors even before driverstatus. But I did not touch this function.
UPD: I replaced the file with the original one, all files were edited in January, also an error 500 on this driverstatus.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2016-03-23
@ThunderCat

Save as UTF-8 without BOM

V
Vitaly Musin, 2016-03-22
@vmpartner

Something inside the function je($responseData); causes an error. Install xdebug and see where it breaks step by step.

A
Aleksei Podgaev, 2016-03-23
@alexiusp

Try to open your file in some simple text editor, best of all, if directly on the hosting, or even in Far.
Perhaps your text editor or the program that you copied this file with tried to apply UTF encoding to the file, which sometimes leads to extra bytes at the beginning of the file. These bytes are what cause the script to crash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question